-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMostrarSimilares.m
More file actions
67 lines (54 loc) · 2.5 KB
/
Copy pathMostrarSimilares.m
File metadata and controls
67 lines (54 loc) · 2.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
function MostrarSimilares(IndicesResultsOrdenado,limiar,novoLimiar,oldLimiar,oldLimIndexes,urlNovo,urls,classes,NumResultados,MS)
%UNTITLED Summary of this function goes here
% Detailed explanation goes here
fprintf("\n\nExpressão providenciada: %s\n\n",cell2mat(urlNovo))
urlsize = length(urls);
if novoLimiar == true
fprintf(" <strong> Não foram encontrados %d URL(s) similar(es) à expressão.\nAqui estão alguns resultados para limiares mais baixos:</strong>\n",NumResultados);
end
if limiar ~= 0
URLresults = urls(IndicesResultsOrdenado);
CLASSresults = classes(IndicesResultsOrdenado);
if oldLimIndexes > 0 && oldLimIndexes < NumResultados
firstURLResults = URLresults(1:oldLimIndexes);
firstCLASSresults = classes(1:oldLimIndexes);
fprintf("\n\tResultados <strong>acima</strong> do limiar desejado:\n")
fprintf("Limiar = %.3f\n",oldLimiar);
fprintf("%40s | CLASSE\n\n",'URL')
for indurl=1:length(firstURLResults)
fprintf("%40s | %s\n",firstURLResults{indurl},string(firstCLASSresults(indurl)))
end
fprintf("\n\tResultados <strong>acima</strong> de um limiar <strong>inferior</strong> ao desejado:\n")
fprintf("Limiar = %.3f\n",limiar);
fprintf("%40s | CLASSE\n\n",'URL')
for indurl=1:(length(URLresults)-length(firstURLResults))
fprintf("%40s | %s\n",URLresults{oldLimIndexes + indurl},string(CLASSresults(oldLimIndexes + indurl)))
end
else
totalResult = length(URLresults);
fprintf("\tResultados:\n")
fprintf("Limiar = %.3f\n",limiar);
fprintf("%40s | CLASSE\n\n",'URL')
for indurl=1:totalResult
fprintf("%40s | %s\n",URLresults{indurl},string(CLASSresults(indurl)))
end
end
fprintf("\n\n")
elseif ~isempty(MS(MS>limiar))
fprintf("Foram <strong>apenas</strong> encontrados os seguintes similares, nos %d URL's:\n",urlsize);
for ind=1:length(IndicesResultsOrdenado)
if MS(IndicesResultsOrdenado(ind)) == 0
IndicesResultsOrdenado(ind) = [];
end
end
URLresults = urls(IndicesResultsOrdenado);
CLASSresults = classes(IndicesResultsOrdenado);
totalResult = length(URLresults);
fprintf("%40s | CLASSE\n\n",'URL')
for indurl=1:totalResult
fprintf("%40s | %s\n",URLresults{indurl},string(CLASSresults(indurl)))
end
else
fprintf("Não foram encontrados resultados similares para a expressão providenciada!\n")
end
end