Revision 11

SRC/src/fr/triangle/hyperalign/kernel/util/ir/Searcher.java (revision 11)
131 131
					Integer numOcc = occurrencesFound.get(div);
132 132
					if(numOcc.intValue()>1){
133 133
						System.out.println("Value /"+key+"/ is nb= "+numOcc+" at Division /"+div.getXmlId()+"/");
134
						Vector<OccurrenceSet> occSet = manager.getAnnotationManager().findOccurrences(key, div, -1, lang, idLemme);
134
						Vector<OccurrenceSet> occSet = manager.getAnnotationManager().findOccurrences(key, div, -1, lang, idLemme, new Vector<OccurrenceSet>());
135 135
						for(int j=0 ; j < occSet.size() ; ++j){
136 136
							OccurrenceSet occ = occSet.get(j);
137 137
							if(occ!=null){
......
181 181
			ArrayList<String> nextWords = new ArrayList<String>();
182 182
			if(tokens.hasMoreTokens()){
183 183
				String token = tokens.nextToken();				
184
				results = searchWord(text, token, sequence);
184
				results = searchWord(text, token, sequence, results);
185 185
				System.out.println("Searcher.searchSequence() = "+token+" in TEXT "+text.getName()+" nb results = "+results.size());
186 186
				searchSequence(text, token, nextWords, results);
187 187
			}
188 188
		}else {//ONE WORD only
189
			results = searchWord(text, sequence, null);
189
			results = searchWord(text, sequence, null, results);
190 190
		}
191 191
		return results;
192 192
	}
......
264 264
	 * @param word
265 265
	 * @return
266 266
	 */
267
	public Vector<OccurrenceSet> searchWord(HyperalignText text, String word, String sequence){
267
	public Vector<OccurrenceSet> searchWord(HyperalignText text, String word, String sequence, Vector<OccurrenceSet> results){
268 268

  
269 269
		//PREPARING RESULTS
270 270
		Vector<OccurrenceSet> result = new Vector<OccurrenceSet>();
......
290 290
					//System.out.println("Searcher.searchWord()  in Division : "+div.computeName());
291 291
					Vector<OccurrenceSet> occSet = null;
292 292
					if(sequence!=null){
293
						occSet = manager.getAnnotationManager().findOccurrences(sequence, div, -1, lang, idLemme);
293
						occSet = manager.getAnnotationManager().findOccurrences(sequence, div, -1, lang, idLemme, results);
294 294
					}else{
295
						occSet = manager.getAnnotationManager().findOccurrences(key, div, -1, lang, idLemme);
295
						occSet = manager.getAnnotationManager().findOccurrences(key, div, -1, lang, idLemme, results);
296 296
					}
297 297
					for(int j=0 ; j < occSet.size() ; ++j){
298 298
						OccurrenceSet occ = occSet.get(j);

Also available in: Unified diff