Révision 13
SRC/src/fr/triangle/hyperalign/kernel/HyperalignData.java (revision 13) | ||
---|---|---|
65 | 65 |
static final public String SHOW_EQUIVALENCES = "showequivalences"; |
66 | 66 |
static final public String HELP_ABOUT = "helpabout"; |
67 | 67 |
static final public String HELP_GUIDE = "helpguide"; |
68 |
static final public String HELP_GUIDE_REGEXP = "helpguideregexp"; |
|
68 | 69 |
|
69 | 70 |
static final public String ANNOTATE = "annotate"; |
70 | 71 |
static final public String EQUAL = "equal"; |
SRC/src/fr/triangle/hyperalign/kernel/util/StringOperation.java (revision 13) | ||
---|---|---|
142 | 142 |
}*/ |
143 | 143 |
|
144 | 144 |
|
145 |
public String multiWordsToString(String [] words){ |
|
146 |
String str = ""; |
|
147 |
for(int i = 0 ; i< words.length; ++i){ |
|
148 |
if(i!=0){ |
|
149 |
str += ", "+words[i]; |
|
150 |
}else { |
|
151 |
str = words[i]; |
|
152 |
} |
|
153 |
} |
|
154 |
return str; |
|
155 |
} |
|
156 |
|
|
145 | 157 |
//Vérifie que cette chaine est bien un mot isolé et non une sous-chaine dans un mot !!! |
146 | 158 |
public boolean isWord(String word, String text, int indexOfWord){ |
147 | 159 |
boolean isWord = true; |
SRC/src/fr/triangle/hyperalign/kernel/DataManager.java (revision 13) | ||
---|---|---|
2481 | 2481 |
DictionaryElement element = (DictionaryElement) obj; |
2482 | 2482 |
//DATA, one line per concept |
2483 | 2483 |
csvLine += element.getName()+";"; |
2484 |
//System.out.println("exportEquivalencesByAuthor (CSV) : "+element.getName()); |
|
2484 | 2485 |
|
2485 | 2486 |
}else { |
2486 | 2487 |
String element = (String) obj; |
... | ... | |
2508 | 2509 |
}else{ |
2509 | 2510 |
csvLine += countOccs+";"; |
2510 | 2511 |
} |
2512 |
//System.out.println("countOccsByText (CSV) : "+countOccs); |
|
2513 |
|
|
2511 | 2514 |
} |
2512 | 2515 |
return csvLine; |
2513 | 2516 |
} |
... | ... | |
2844 | 2847 |
if(!allLemmes){ |
2845 | 2848 |
HashMap<Object,Integer> results = new HashMap<Object, Integer>(); |
2846 | 2849 |
HashMap<Object, Integer> equivalences = findEquivalences(lemmeElement, targetLang, results); |
2847 |
manager.writeToDebug("EquivalenceManager.computeGraphEquivalences() - 2 - for LANG : "+targetLang+" NB TARGETS > "+equivalences.size());
|
|
2850 |
System.out.println("EquivalenceManager.computeGraphEquivalences() - 2 - for LANG : "+targetLang+" NB TARGETS > "+equivalences.size());
|
|
2848 | 2851 |
|
2849 | 2852 |
HashMap<Object,HashMap<Object, Integer>> equivalencesByLemme = new HashMap<Object, HashMap<Object,Integer>>(); |
2850 | 2853 |
equivalencesByLemme.put(lemmeElement, equivalences); |
... | ... | |
2854 | 2857 |
}else { |
2855 | 2858 |
HashMap<Object, HashMap<Object,Integer>> results = new HashMap<Object, HashMap<Object,Integer>>(); |
2856 | 2859 |
HashMap<Object, HashMap<Object,Integer>> equivalencesByLemme = groupEquivalencesByLemme(lemmeElement, targetLang, results); |
2857 |
manager.writeToDebug("EquivalenceManager.computeGraphEquivalences() - 1 - for ALL in : "+targetLang+" NB LEMMES > "+equivalencesByLemme.size());
|
|
2860 |
System.out.println("EquivalenceManager.computeGraphEquivalences() - 1 - for ALL in : "+targetLang+" NB LEMMES > "+equivalencesByLemme.size());
|
|
2858 | 2861 |
|
2859 | 2862 |
Integer level = new Integer(neighbourhWidth); |
2860 | 2863 |
EquivalenceGraphWriter writer = new EquivalenceGraphWriter(this, equivalencesByLemme, level, null); |
... | ... | |
2958 | 2961 |
computeGraphEquivalences(element, targetLang, "1", true); |
2959 | 2962 |
//computeGraphEquivalences(sourceElements, targetElements, neighbourhoodWidth, filterByAuthor); |
2960 | 2963 |
}else { |
2961 |
manager.writeToDebug("EquivalenceManager.buildInfoForGraph() - FOR "+element+" [level "+element.getReference()+"]");
|
|
2964 |
System.out.println("EquivalenceManager.buildInfoForGraph() - FOR "+element+" [level "+element.getReference()+"]");
|
|
2962 | 2965 |
computeGraphEquivalences(element, targetLang, neighbourhoodWidth, false); |
2963 | 2966 |
} |
2964 | 2967 |
} |
... | ... | |
3105 | 3108 |
|
3106 | 3109 |
if(str instanceof DictionaryElement){ |
3107 | 3110 |
DictionaryElement el = (DictionaryElement) str; |
3108 |
manager.writeToDebug("EquivalenceManager.findEquivalences() FOR "+el.getName()+" Level ("+el.getReference()+") in TARGET LANG "+dicoTarget);
|
|
3111 |
System.out.println("EquivalenceManager.findEquivalences() FOR "+el.getName()+" Level ("+el.getReference()+") in TARGET LANG "+dicoTarget);
|
|
3109 | 3112 |
|
3110 | 3113 |
|
3111 | 3114 |
if(el.getReference().equals(Dictionary.DICO_OCC)){ |
3112 | 3115 |
OccurrenceSet occ = el.getOccurrence(); |
3113 | 3116 |
EquivalenceElement equivalence = occ.getEquivalence(); |
3114 | 3117 |
if(equivalence!=null){ |
3115 |
HyperalignText text = occ.getDivision().getText();
|
|
3118 |
//peralignText text = occ.getDivision().getText();
|
|
3116 | 3119 |
HashMap<HyperalignText, OccurrenceSet> elements = equivalence.getElements(); |
3117 | 3120 |
Set<HyperalignText> keys = elements.keySet(); |
3118 | 3121 |
Iterator<HyperalignText> it = keys.iterator(); |
3119 | 3122 |
while(it.hasNext()){ |
3120 | 3123 |
HyperalignText textOcc = it.next(); |
3121 |
manager.writeToDebug("\tfindEquivalences ony occs from target lang => "+textOcc.getMainLang());
|
|
3124 |
System.out.println("\tfindEquivalences only occs from target lang => "+textOcc.getMainLang());
|
|
3122 | 3125 |
|
3123 | 3126 |
if(textOcc.getMainLang().equals(dicoTarget.getName())){ |
3124 | 3127 |
OccurrenceSet occEqui = elements.get(textOcc); |
... | ... | |
3128 | 3131 |
if(results.containsKey(lemme)){ |
3129 | 3132 |
Integer nbOccs = results.get(lemme); |
3130 | 3133 |
nbOccs = new Integer(nbOccs.intValue()+1); |
3134 |
results.put(lemme, nbOccs); |
|
3131 | 3135 |
}else { |
3132 | 3136 |
results.put(lemme, new Integer(1)); |
3133 |
manager.writeToDebug("\tPUT LEMME > "+lemme+ " from "+textOcc.getMainLang());
|
|
3137 |
System.out.println("\tPUT LEMME > "+lemme+ " from "+textOcc.getMainLang());
|
|
3134 | 3138 |
|
3135 | 3139 |
} |
3136 | 3140 |
//PUT FORM TO THE EQUIVALENCE |
3137 | 3141 |
}else { |
3138 |
manager.writeToDebug("\tPUT STRING > "+occEqui.getValue()+ " from "+textOcc.getMainLang());
|
|
3142 |
System.out.println("\tPUT STRING > "+occEqui.getValue()+ " from "+textOcc.getMainLang());
|
|
3139 | 3143 |
|
3140 | 3144 |
results.put(occEqui.getValue(), new Integer(1)); |
3141 | 3145 |
} |
... | ... | |
3184 | 3188 |
if(resultsByAuthor.containsKey(lemme)){ |
3185 | 3189 |
Integer nbOccs = resultsByAuthor.get(lemme); |
3186 | 3190 |
nbOccs = new Integer(nbOccs.intValue()+1); |
3191 |
resultsByAuthor.put(lemme, nbOccs); |
|
3187 | 3192 |
}else{ |
3188 | 3193 |
resultsByAuthor.put(lemme, new Integer(1)); |
3189 | 3194 |
} |
SRC/src/fr/triangle/hyperalign/gui/HMMenuBar.java (revision 13) | ||
---|---|---|
147 | 147 |
makeMenuItem(menuHelp, HyperalignData.HELP_ABOUT, res.getString("I18N_MENU_HELP_ABOUT"), KeyEvent.VK_T, null); |
148 | 148 |
//------ GUIDE |
149 | 149 |
makeMenuItem(menuHelp, HyperalignData.HELP_GUIDE, res.getString("I18N_MENU_HELP_GUIDE"), KeyEvent.VK_T, null); |
150 |
//------ GUIDE REGEXP |
|
151 |
makeMenuItem(menuHelp, HyperalignData.HELP_GUIDE_REGEXP, res.getString("I18N_MENU_HELP_GUIDE_REGEXP"), KeyEvent.VK_T, null); |
|
150 | 152 |
} |
151 | 153 |
|
152 | 154 |
private void createEditionMenu(){ |
... | ... | |
675 | 677 |
manager.getSearchManager().doubleSearchWithIndex(false, Terminology.CONCEPT); |
676 | 678 |
}else if (HyperalignData.HELP_ABOUT.equals(cmd)){ |
677 | 679 |
about(res.getString("I18N_MENU_HELP_ABOUT_VERSION"), res.getString("I18N_MENU_HELP_ABOUT_TITLE")); |
680 |
}else if (HyperalignData.HELP_GUIDE_REGEXP.equals(cmd)){ |
|
681 |
HelpPane helpPane = new HelpPane(HyperalignData.HELP_GUIDE_REGEXP); |
|
682 |
helpPane.setLocationRelativeTo(Hypermachiavel.getInstance()); |
|
683 |
helpPane.setAlwaysOnTop(true); |
|
678 | 684 |
}else if (HyperalignData.HELP_GUIDE.equals(cmd)){ |
679 | 685 |
/*HelpSet helpset = null; |
680 | 686 |
ClassLoader loader = null; |
... | ... | |
689 | 695 |
System.err.println("Error loading > Help Guide : "+he); |
690 | 696 |
return; |
691 | 697 |
}*/ |
692 |
Hypermachiavel.getInstance().functionInProgress(); |
|
698 |
HelpPane helpPane = new HelpPane(HyperalignData.HELP_GUIDE); |
|
699 |
helpPane.setLocationRelativeTo(Hypermachiavel.getInstance()); |
|
700 |
helpPane.setAlwaysOnTop(true); |
|
701 |
//Hypermachiavel.getInstance().functionInProgress(); |
|
693 | 702 |
}else if (HyperalignData.CREATE_DICO.equals(cmd)){ |
694 | 703 |
manager.buildDictionaryFromCorpus(); |
695 | 704 |
} |
SRC/src/fr/triangle/hyperalign/gui/graph/EquivalenceGraph.java (revision 13) | ||
---|---|---|
23 | 23 |
import javax.swing.ImageIcon; |
24 | 24 |
import javax.swing.JButton; |
25 | 25 |
import javax.swing.JCheckBox; |
26 |
import javax.swing.JComboBox; |
|
26 | 27 |
import javax.swing.JLabel; |
27 | 28 |
import javax.swing.JPanel; |
28 | 29 |
import javax.swing.JTextArea; |
... | ... | |
72 | 73 |
private void initGui(){ |
73 | 74 |
//this.setLayout(new GridLayout(1,urlsEquivalence.length)); |
74 | 75 |
|
75 |
//JPanel northPanel = new JPanel();
|
|
76 |
JToolBar northPanel = new JToolBar(); |
|
76 |
JPanel northPanel = new JPanel(); |
|
77 |
//JToolBar northPanel = new JToolBar();
|
|
77 | 78 |
if(urlsEquivalence.length>1){ |
78 | 79 |
//LABEL about Concept, Lang and Level |
79 | 80 |
URL urlEqui = urlsEquivalence[0]; |
80 | 81 |
initParams(urlEqui); |
81 |
JLabel textLabelConceptLevel = new JLabel(concept+", "+res.getString("I18N_EQUIVALENCEGRAPH_LEVEL")+level); |
|
82 |
JLabel textLabelConceptLevel = new JLabel(res.getString("I18N_EQUIVALENCEGRAPH_LANGUAGE")+lang+", "+res.getString("I18N_EQUIVALENCEGRAPH_CONCEPT")+concept+", "+res.getString("I18N_EQUIVALENCEGRAPH_LEVEL")+level);
|
|
82 | 83 |
textLabelConceptLevel.setPreferredSize(new Dimension(400,20)); |
83 | 84 |
|
84 | 85 |
northPanel.add(textLabelConceptLevel); |
... | ... | |
86 | 87 |
//PROPORTION NODE SIZE |
87 | 88 |
graphSizeBox = new JCheckBox(res.getString("I18N_EQUIVALENCEPANE_GRAPHSIZE_OPTION")); |
88 | 89 |
graphSizeBox.setSelected(withSizes); |
89 |
//graphSizeBox.setPreferredSize(new Dimension(100,10)); |
|
90 | 90 |
graphSizeBox.addItemListener(this); |
91 | 91 |
northPanel.add(graphSizeBox); |
92 | 92 |
|
... | ... | |
207 | 207 |
String path = urlEquivalence.getPath(); |
208 | 208 |
int index = path.lastIndexOf("/"); |
209 | 209 |
path = path.substring(index+1,path.length()); |
210 |
System.out.println("INIT PATH : "+path); |
|
210 | 211 |
|
211 | 212 |
index = path.indexOf("_"); |
212 | 213 |
if(index!=-1){ |
213 | 214 |
//GESTION DE LA LANGUE : |
214 |
lang += path.substring(0,index);
|
|
215 |
lang = path.substring(0,index); |
|
215 | 216 |
path = path.substring(index+1,path.length()); |
216 | 217 |
index = path.indexOf("_"); |
217 |
|
|
218 |
System.out.println("AFTER REMOVE LANG : "+path+" / index @"+index); |
|
218 | 219 |
if(index!=-1){ |
219 | 220 |
//GESTION CONCEPT |
220 | 221 |
concept = path.substring(0,index); |
221 | 222 |
path = path.substring(index+1,path.length()); |
222 | 223 |
index = path.indexOf("_"); |
223 |
|
|
224 |
System.out.println("AFTER REMOVE CONCEPT : "+path+" / index @"+index); |
|
224 | 225 |
if(urlsEquivalence.length>1){ |
225 | 226 |
if(index!=-1){ |
226 | 227 |
//GESTION TEXTE |
... | ... | |
228 | 229 |
path = path.substring(index+1,path.length()); |
229 | 230 |
index = path.indexOf("_"); |
230 | 231 |
author = manager.getDataManager().getCorpusManager().getCorpus().getTextById(author).getName(); |
231 |
|
|
232 |
if(index!=-1){
|
|
232 |
System.out.println("AFTER REMOVE AUTHOR : "+path+" / index @"+index); |
|
233 |
if(index==-1){
|
|
233 | 234 |
//GESTION LEVEL |
234 |
level = path.substring(0,index); |
|
235 |
path = path.substring(index+1,path.length()); |
|
235 |
level = path.substring(0,1); |
|
236 | 236 |
} |
237 | 237 |
} |
238 | 238 |
}else { |
... | ... | |
269 | 269 |
if (e.getStateChange() == ItemEvent.SELECTED){ |
270 | 270 |
withSizes = true; |
271 | 271 |
} |
272 |
|
|
272 |
reinitPane(this.urlsEquivalence, this.withSizes, this.withAllConcepts); |
|
273 | 273 |
} |
274 | 274 |
|
275 | 275 |
} |
SRC/src/fr/triangle/hyperalign/gui/graph/GraphPane.java (revision 13) | ||
---|---|---|
150 | 150 |
ColorAction edges = new ColorAction(GraphPane.edges, VisualItem.STROKECOLOR, ColorLib.gray(100)); |
151 | 151 |
ColorAction edgesText = new ColorAction(GraphPane.edges, VisualItem.TEXTCOLOR, ColorLib.blue(120)); |
152 | 152 |
|
153 |
//DataSizeAction size = new DataSizeAction(EquivalenceGraph.nodes, "nb", 10, Constants.LOG_SCALE); |
|
154 |
System.out.println("withSizes ? => "+withSizes); |
|
155 | 153 |
// 1) the DataSizeAction for the edges based on datafield "weight" |
156 |
Action dataSizeAction = new DataSizeAction(GraphPane.nodes, "nb");
|
|
157 |
|
|
154 |
System.out.println("withSizes ? => "+withSizes+" >>> "+Constants.LOG_SCALE);
|
|
155 |
Action dataSizeAction = new DataSizeAction(GraphPane.nodes, "nb", 10, Constants.LOG_SCALE); |
|
158 | 156 |
//// create an action list containing all color assignments |
159 | 157 |
//Constants.QUANTILE_SCALE |
160 | 158 |
//Constants.LOG_SCALE |
SRC/src/fr/triangle/hyperalign/gui/HelpPane.java (revision 13) | ||
---|---|---|
1 |
package fr.triangle.hyperalign.gui; |
|
2 |
|
|
3 |
import java.awt.Dimension; |
|
4 |
import java.io.IOException; |
|
5 |
|
|
6 |
import javax.swing.JDialog; |
|
7 |
import javax.swing.JEditorPane; |
|
8 |
|
|
9 |
import fr.triangle.hyperalign.kernel.HyperalignData; |
|
10 |
|
|
11 |
public class HelpPane extends JDialog { |
|
12 |
|
|
13 |
String type; |
|
14 |
public HelpPane(String type){ |
|
15 |
this.type = type; |
|
16 |
initGui(); |
|
17 |
} |
|
18 |
|
|
19 |
private void initGui(){ |
|
20 |
JEditorPane editorPane = new JEditorPane(); |
|
21 |
String url=""; |
|
22 |
if(type.equals(HyperalignData.HELP_GUIDE)){ |
|
23 |
url = "http://w6.ens-lyon.fr/devsite/hyperprince/Hypermachiavel_UserGuide_HTML/guideprat.html"; |
|
24 |
} |
|
25 |
if(type.equals(HyperalignData.HELP_GUIDE_REGEXP)){ |
|
26 |
url = "http://www.vogella.com/articles/JavaRegularExpressions/article.html#regex_metacharacters"; |
|
27 |
} |
|
28 |
editorPane.setEditable(false); |
|
29 |
try { |
|
30 |
editorPane.setPage(url); |
|
31 |
} catch (IOException e) { |
|
32 |
System.err.println("Attempted to read a bad URL: " + url); |
|
33 |
} |
|
34 |
this.add(editorPane); |
|
35 |
this.setTitle(type); |
|
36 |
this.setPreferredSize(new Dimension(600,800)); |
|
37 |
this.pack(); |
|
38 |
this.setVisible(true); |
|
39 |
|
|
40 |
} |
|
41 |
|
|
42 |
} |
|
43 |
|
|
44 |
|
|
45 |
|
SRC/src/fr/triangle/hyperalign/gui/HMManager.java (revision 13) | ||
---|---|---|
1155 | 1155 |
return null; |
1156 | 1156 |
} |
1157 | 1157 |
|
1158 |
|
|
1158 | 1159 |
|
1159 | 1160 |
public boolean setNameForText(){ |
1160 | 1161 |
boolean uploadedText = false; |
... | ... | |
2279 | 2280 |
Vector<OccurrenceSet> results = searcher.search(selectedTexts); |
2280 | 2281 |
resultManager.setSearcher(searcher); |
2281 | 2282 |
resultManager.setResults(results); |
2282 |
|
|
2283 |
resultManager.setMessage(StringOperation.getInstance().multiWordsToString(words)); |
|
2283 | 2284 |
if(results.size()!=0){ |
2284 | 2285 |
mainFrame.reinitCenterPane(Hypermachiavel.RESULT_TAB, true); |
2285 | 2286 |
return true; |
... | ... | |
2341 | 2342 |
resultManager.setSearcher(searcher); |
2342 | 2343 |
resultManager.setResults(results); |
2343 | 2344 |
resultManager.showMerge(false); |
2345 |
resultManager.setMessage(StringOperation.getInstance().multiWordsToString(words)); |
|
2344 | 2346 |
if(results.size()!=0){ |
2345 | 2347 |
mainFrame.reinitCenterPane(Hypermachiavel.RESULT_TAB, true); |
2346 | 2348 |
return true; |
... | ... | |
2449 | 2451 |
resultManager.setColumns(columnNames); |
2450 | 2452 |
resultManager.setBilingualSearcher(bilingualSearcher); |
2451 | 2453 |
resultManager.setEquivalenceResults(results); |
2454 |
resultManager.setMessage("? sourceElements <=> ? targetElements "); |
|
2452 | 2455 |
|
2453 | 2456 |
if(results.size()!=0){ |
2454 | 2457 |
mainFrame.reinitCenterPane(Hypermachiavel.RESULT_TAB, true); |
SRC/src/fr/triangle/hyperalign/gui/annot/AnnotEquiPane.java (revision 13) | ||
---|---|---|
762 | 762 |
csvLine += res.getString("I18N_EQUIVALENCEPANE_EXPORTAUTHOR_LABEL1")+conceptEquiEl.getName()+ |
763 | 763 |
" ["+sourceLang.getName()+"] "+ |
764 | 764 |
nbOccSourceInEqui+" "+res.getString("I18N_EQUIVALENCEPANE_EXPORTAUTHOR_LABEL2")+";"; |
765 |
tradManager.exportEquivalencesByAuthor(sourceElement, conceptEquivalenceElements, csvLine, targetLang); |
|
765 |
csvLine = tradManager.exportEquivalencesByAuthor(sourceElement, conceptEquivalenceElements, csvLine, targetLang);
|
|
766 | 766 |
manager.saveWork(csvLine); |
767 | 767 |
} |
768 | 768 |
} |
... | ... | |
987 | 987 |
} |
988 | 988 |
if (e.getStateChange() == ItemEvent.SELECTED){ |
989 | 989 |
withSizes = true; |
990 |
|
|
990 | 991 |
} |
992 |
initGuiWithTable(); |
|
991 | 993 |
|
992 | 994 |
} |
993 | 995 |
|
SRC/res/fr/triangle/hyperalign/gui/i18n/LabelsBundle_fr_FR.properties (revision 13) | ||
---|---|---|
207 | 207 |
I18N_MENU_HELP_ABOUT_TITLE = A propos |
208 | 208 |
I18N_MENU_HELP_ABOUT_VERSION = Hypermachiavel (Version 2) \n http://www.projet-plume.org/relier/hypermachiavel\n http://hyperprince.ens-lyon.fr \nd?velopp? par S?verine Gedzelman, ENS de LYON\n financ? dans le cadre d'une ANR 2007-2010\n Licence Cecill-B depuis 2009 |
209 | 209 |
I18N_MENU_HELP_GUIDE = Guide pratique |
210 |
I18N_MENU_HELP_GUIDE_REGEXP = Aide sur la syntaxe pour les fonctions de recherche |
|
210 | 211 |
|
211 | 212 |
I18N_MENU_SAVE_MESSAGE_TITLE = Sauvegarde |
212 | 213 |
|
... | ... | |
532 | 533 |
I18N_EQUIVALENCEGRAPH_ALLAUTHORS = Tout auteur confondu |
533 | 534 |
I18N_EQUIVALENCEGRAPH_LANGUAGE = Langue : |
534 | 535 |
I18N_EQUIVALENCEGRAPH_BY = chez |
535 |
I18N_EQUIVALENCEGRAPH_LEVEL = niveau |
|
536 |
I18N_EQUIVALENCEGRAPH_LEVEL = Niveau : |
|
537 |
I18N_EQUIVALENCEGRAPH_CONCEPT = Concept : |
|
538 |
|
|
536 | 539 |
#---------------- |
537 | 540 |
# EQUIVALENCE PANE |
538 | 541 |
#---------------- |
Formats disponibles : Unified diff