Révision 2165
tmp/org.txm.concordance.core/src/org/txm/concordance/core/functions/comparators/LexicographicRightContextComparator.java (revision 2165) | ||
---|---|---|
60 | 60 |
*/ |
61 | 61 |
@Override |
62 | 62 |
public int compare(Line l1, Line l2) { |
63 |
if (l1 == null) return 0; |
|
64 |
if (l2 == null) return 0; |
|
63 | 65 |
int rez = 0; |
64 | 66 |
int i = 0; // property counter |
65 | 67 |
int j = 0; // position counter |
66 | 68 |
HashMap<Property, List<String>> values1 = l1.getRightAnalysisProperty(); |
69 |
if (values1 == null) return 0; |
|
70 |
|
|
67 | 71 |
HashMap<Property, List<String>> values2 = l2.getRightAnalysisProperty(); |
72 |
if (values2 == null) return 0; |
|
73 |
|
|
68 | 74 |
this.conc = l1.getConcordance(); |
69 | 75 |
this.props = conc.getRightAnalysisProperties(); |
70 | 76 |
|
71 |
List<String> vals1; |
|
72 |
List<String> vals2; |
|
73 |
|
|
74 | 77 |
String v1, v2; |
75 | 78 |
|
76 | 79 |
int size1 = values1.get(props.get(0)).size(); |
77 | 80 |
int size2 = values2.get(props.get(0)).size(); |
78 | 81 |
|
79 | 82 |
while (rez == 0) { |
80 |
// vals1 = values1.get(props.get(i)); |
|
81 |
// vals2 = values2.get(props.get(i)); |
|
82 |
|
|
83 | 83 |
//System.out.println("LINE 1: "+vals1); |
84 | 84 |
//System.out.println("LINE 2: "+vals2); |
85 |
if(size1 <= j && size2 <= j) |
|
85 |
if (size1 <= j && size2 <= j)
|
|
86 | 86 |
return 0; // end of line 1 |
87 | 87 |
if (size1 <= j) |
88 | 88 |
return -1; // end of line 1 |
Formats disponibles : Unified diff