Revision 10

SRC/src/fr/triangle/hyperalign/kernel/util/DebugToFile.java (revision 10)
11 11
public class DebugToFile {
12 12
	
13 13
	private OutputStreamWriter out;
14
	private boolean isDebug=false;
14 15
	
15 16
	public DebugToFile(String nameText){
16 17
		String fileName = nameText+".txt";
......
31 32
		}
32 33
	}
33 34

  
35
	public boolean isDebug(){
36
		return isDebug;
37
	}	
34 38
	
39
	public void setStateDebug(boolean stateDebug){
40
		this.isDebug=stateDebug;
41
	}	
42
	
35 43
	public void endBuildFileForDebug(){
36 44
		try {
37 45
			out.close();
SRC/src/fr/triangle/hyperalign/kernel/bd/DatabaseManager.java (revision 10)
445 445
		return returnStr;
446 446
	}
447 447
	
448
	public static ArrayList<String> getAnnotations(String str, Division div){
449
		ArrayList<String> ids = new ArrayList<String>();
450
	
451
		try {
452
			Connection conn = createConnection();
453
			Statement stat = conn.createStatement();
454
			ResultSet rs = stat.executeQuery("SELECT * FROM "+DB_TABLE_ANNOTATIONS+" WHERE "+DB_DIV+"='"+div.getXmlId()+"';");
455
			while (rs.next()) {
456
				if(rs.getString(DB_VAL).equals(str)){
457
					ids.add(rs.getString(DB_IDENTIFICATION));
458
				}
459
			}
460
			rs.close();
461
			conn.close();
462
		}  catch ( Exception e) { 
463
			System.err.println(e);//e.printStackTrace();
464
			return ids;
465
		}
466
		System.out.println("Test.getAnnotations() - "+div.getXmlId()+" /"+str+"/ in "+div.getXmlId()+" = "+ids.size()+" annots");
467
		
468
		return ids;
469
	}
470
	
448 471
	public static String isAnnotation(Division div, int debIndex, int endIndex){
449 472
		//System.out.println("Test.isAnnotation() ["+debIndex+"-"+endIndex+"] ");
450 473
		String returnStr = null;
SRC/src/fr/triangle/hyperalign/kernel/trad/ConceptEquivalenceElement.java (revision 10)
51 51
					Vector<OccurrenceSet> occs = occurrencesByName.get(objc);
52 52
					if(!occs.contains(occ)){
53 53
						occs.add(occ);
54
						System.out.println("\tadd OCC ["+occ+"] to "+lemme.getName());	
54
						//System.out.println("\tadd OCC ["+occ+"] to "+lemme.getName());	
55 55
					}
56 56
				}
57 57
			}
......
59 59
		if(!found){
60 60
			Vector<OccurrenceSet> occs = new Vector<OccurrenceSet>();
61 61
			occs.add(occ);
62
			System.out.println("NAME ["+lemme.getName()+"]");				
63
			System.out.println("\tadd OCC ["+occ+"] to "+lemme.getName());	
62
			//System.out.println("NAME ["+lemme.getName()+"]");				
63
			//System.out.println("\tadd OCC ["+occ+"] to "+lemme.getName());	
64 64
			occurrencesByName.put(lemme, occs);
65 65
		}
66 66
	}
......
73 73
			Object obj = it.next();
74 74
			if(obj instanceof String){
75 75
				String objs = (String) obj;
76
				System.out.println("ConceptEquivalenceElement =>>> CLE SIMILAIRE ? : /"+objs+"/ et /"+name+"/");
76
				//System.out.println("ConceptEquivalenceElement =>>> CLE SIMILAIRE ? : /"+objs+"/ et /"+name+"/");
77 77
				if(objs.equals(name)){
78 78
					found = true;
79 79
					Vector<OccurrenceSet> occs = occurrencesByName.get(objs);
80 80
					if(!occs.contains(occ)){
81 81
						occs.add(occ);
82
						System.out.println("\tadd OCC ["+occ+"] to "+name);	
82
						//System.out.println("\tadd OCC ["+occ+"] to "+name);	
83 83
					}
84 84
				}
85 85
			}
86 86
		}
87 87
		if(!found){
88 88
			Vector<OccurrenceSet> occs = new Vector<OccurrenceSet>();
89
			System.out.println("ConceptEquivalenceElement =>>> NOUVELLE CLE : /"+name+"/");
89
			//System.out.println("ConceptEquivalenceElement =>>> NOUVELLE CLE : /"+name+"/");
90 90
						
91
			System.out.println("\tadd OCC ["+occ+"] to "+name);	
91
			//System.out.println("\tadd OCC ["+occ+"] to "+name);	
92 92
			occs.add(occ);
93 93
			occurrencesByName.put(name, occs);
94 94
		}
95 95
	}
96 96
	
97 97
	public void removeOccurrence(OccurrenceSet occ){
98
		System.out.println("ConceptEquivalenceElement.removeOccurrence() - TO DO ");
98
		//System.out.println("ConceptEquivalenceElement.removeOccurrence() - TO DO ");
99 99
	}
100 100
	
101 101
	public HashMap<Object,Vector<OccurrenceSet>> getOccurrences(){
SRC/src/fr/triangle/hyperalign/kernel/trad/EquivalenceElement.java (revision 10)
69 69
	public EquivalenceElement(EquivalenceElement parent, String reference, String id,
70 70
			OccurrenceSet occSet, String comment, ParallelTextElement localisation) {
71 71
		super(parent, localisation.computeName(), id);
72
		System.out.println("NEW EQUI ["+id+"] \n\tEQUIVALENCE ELEMENT "+occSet.getValue() +" | "+occSet.getIdentification());
72
		//System.out.println("NEW EQUI ["+id+"] \n\tEQUIVALENCE ELEMENT "+occSet.getValue() +" | "+occSet.getIdentification());
73 73

  
74 74
		this.comment = comment;
75 75
		this.reference = reference;
......
180 180
		if(elements!=null){
181 181
			if(!elements.containsKey(textRef)){
182 182
				elements.put(textRef,el);
183
				System.out.println("\tEQUIVALENCE ELEMENT "+el.getValue()+" | "+ el.getIdentification());
183
				//System.out.println("\tEQUIVALENCE ELEMENT "+el.getValue()+" | "+ el.getIdentification());
184 184

  
185 185
				//System.out.println("Equivalence.addElement() - ELEMENT ------ "+el.getValue()+" AT TEXT "+textRef.getId());
186 186
			}else{
187 187
				//elements.put(textRef,el);
188
				System.out.println("Equivalence.addElement() - "+el.getValue()+" WAS ALREADY in TEXT "+textRef+" ------ ");
188
				//System.out.println("Equivalence.addElement() - "+el.getValue()+" WAS ALREADY in TEXT "+textRef+" ------ ");
189 189
			}
190 190
		}else {
191 191
			elements = new HashMap<HyperalignText, OccurrenceSet>();
SRC/src/fr/triangle/hyperalign/kernel/trad/Equivalence.java (revision 10)
80 80
		if(url==null){
81 81
			EquivalenceElement newroot = new EquivalenceElement(this, name, EQUIVALENCE_TREE, "EQUIV_"+name);
82 82
			setRoot(newroot);
83
			System.out.println("EquivalenceTree.buildData() - URL IS NULL [Root is => "+getRoot()+"]");
83
			//System.out.println("EquivalenceTree.buildData() - URL IS NULL [Root is => "+getRoot()+"]");
84 84
		}
85 85
		else {
86 86
			HyperalignBuilder builder = new HyperalignBuilder(manager, false);
......
146 146
			}
147 147
			return concept;
148 148
		}else {
149
			System.out.println("PAS DE ROOT ???");
149
			//System.out.println("Equivalence - PAS DE ROOT ???");
150 150
			return null;
151 151
		}
152 152
	}
......
173 173
			}
174 174
			return concept;
175 175
		}else {
176
			System.out.println("PAS DE ROOT ???");
176
			//System.out.println("Equivalence - PAS DE ROOT ???");
177 177
			return null;
178 178
		}
179 179
	}
......
279 279
	
280 280
	public EquivalenceElement checkElementAsChild(EquivalenceElement parent, 
281 281
			ParallelTextElement loc, OccurrenceSet occSet){
282
		System.out.println("Equivalence.checkElementAsChild() - LOCALISATION "+loc);
282
		//System.out.println("Equivalence.checkElementAsChild() - LOCALISATION "+loc);
283 283
		
284 284
		if(parent!=null){
285 285
			Vector<EquivalenceElement> children = parent.children();
......
294 294
							}
295 295
						}
296 296
					}else {
297
						System.out.println("!!!!!!!!!!!!!!!!!!!!!!!! Equivalence.checkElementAsChild() - ### Equi "+child.getId()+" LOCALISATION IS NULL");
297
						//System.out.println("!!!!!!!!!!!!!!!!!!!!!!!! Equivalence.checkElementAsChild() - ### Equi "+child.getId()+" LOCALISATION IS NULL");
298 298
						
299 299
					}
300 300
				}
SRC/src/fr/triangle/hyperalign/gui/concord/ResultPane.java (revision 10)
240 240
				OccurrenceSet occSet = (OccurrenceSet) queryManager.getResults().get(i);
241 241
				Division div = occSet.getDivision();
242 242
				String localisation = div.computeNameWithoutTextRef();
243
				System.out.println("ResultPane.initConcordanceData() --- Localisation ["+localisation+"]");
243
				//System.out.println("ResultPane.initConcordanceData() --- Localisation ["+localisation+"]");
244 244
				int numCol = 1;
245 245
				boolean showId = params.showId();
246 246
				int nbWordsForContext = params.getNbWords();
SRC/src/fr/triangle/hyperalign/gui/text/VocabularyPane.java (revision 10)
706 706
						System.out.println("How many texts are selected ? "+selectedTexts.size());
707 707
						for(HyperalignText selectedText : selectedTexts){
708 708
							Searcher searcher = new Searcher(manager.getDataManager(), dico, words);
709
							occVect = searcher.searchWord(selectedText, word, null);
709
							occVect = searcher.searchWord(selectedText, word, null, new Vector<OccurrenceSet>());
710 710
							results = addOccurrencesToResult(occVect, results, false);
711 711

  
712 712
						}

Also available in: Unified diff