Révision 2377
| tmp/org.txm.cooccurrence.core/src/org/txm/cooccurrence/core/functions/Cooccurrence.java (revision 2377) | ||
|---|---|---|
| 1168 | 1168 |
} |
| 1169 | 1169 |
|
| 1170 | 1170 |
noOcc = 0; |
| 1171 |
for (int position : positions) {
|
|
| 1171 |
for (int position : positions) { // cooccurent words positions
|
|
| 1172 | 1172 |
// String signature = allsignatures.get(position); |
| 1173 | 1173 |
String signaturestr = allsignaturesstr.get(position); |
| 1174 | 1174 |
if (o.getStart() <= position && position <= o.getEnd()) {
|
| ... | ... | |
| 1195 | 1195 |
keepedPosition.add(position); |
| 1196 | 1196 |
|
| 1197 | 1197 |
double dist; |
| 1198 |
if (position < m.getStart()) {
|
|
| 1198 |
if (position <= m.getStart()) {
|
|
| 1199 | 1199 |
dist = m.getStart() - position; |
| 1200 |
} else if (m.getEnd() <= position) {
|
|
| 1201 |
dist = position - m.getEnd(); |
|
| 1202 |
} else { // the n match is in the m match !?
|
|
| 1203 |
System.out.println("Warning: the n match is in the m match ? "+n+ " "+m);
|
|
| 1204 |
dist = 0; |
|
| 1200 | 1205 |
} |
| 1201 |
else {
|
|
| 1202 |
dist = position - m.getStart(); |
|
| 1203 |
} |
|
| 1204 | 1206 |
|
| 1205 | 1207 |
distances.put(signaturestr, (distances.get(signaturestr)) + dist); |
| 1206 | 1208 |
distancesCounts.put(signaturestr, (distancesCounts.get(signaturestr)) + 1); |
Formats disponibles : Unified diff