Révision 3582
TXM/trunk/org.txm.core/src/java/org/txm/objects/Project.java (revision 3582) | ||
---|---|---|
1357 | 1357 |
return params.getBoolean("doTokenizeStep", true); |
1358 | 1358 |
} |
1359 | 1359 |
|
1360 |
public void setDoTokenizerStep(boolean doit) { |
|
1361 |
addTokenizerParameter("doTokenizeStep", "" + doit); //$NON-NLS-1$ //$NON-NLS-2$ |
|
1362 |
} |
|
1363 |
|
|
1360 | 1364 |
public EditionDefinition getEditionDefinition(String name) { |
1361 | 1365 |
return new EditionDefinition(this, name); |
1362 | 1366 |
} |
TXM/trunk/TXMAlphaPlugins.site/site.xml (revision 3582) | ||
---|---|---|
3 | 3 |
<description name="TXM Extensions - Alpha" url="https://gitlab.huma-num.fr/txm/txm-software/-/raw/master/dist/0.8.2/ext/alpha"> |
4 | 4 |
This update site contains the Alpha extensions for TXM |
5 | 5 |
</description> |
6 |
<feature url="features/org.txm.annotation.urs.feature_1.0.0.202207281752.jar" id="org.txm.annotation.urs.feature" version="1.0.0.202207281752"/> |
|
7 |
<feature url="features/org.txm.backtomedia.feature_1.0.0.202207281752.jar" id="org.txm.backtomedia.feature" version="1.0.0.202207281752"/> |
|
8 |
<feature url="features/org.txm.dictionary.feature_1.0.0.202207281752.jar" id="org.txm.dictionary.feature" version="1.0.0.202207281752"/> |
|
9 |
<feature url="features/org.txm.oriflamms.feature_1.0.0.202207281752.jar" id="org.txm.oriflamms.feature" version="1.0.0.202207281752"/> |
|
10 |
<feature url="features/org.txm.svn.feature_1.0.0.202207281752.jar" id="org.txm.svn.feature" version="1.0.0.202207281752"/> |
|
11 |
<feature url="features/org.txm.textsbalance.feature_1.0.0.202207281752.jar" id="org.txm.textsbalance.feature" version="1.0.0.202207281752"/> |
|
12 |
<feature url="features/org.txm.translate.feature_1.0.0.202207281752.jar" id="org.txm.translate.feature" version="1.0.0.202207281752"/> |
|
13 |
<feature url="features/org.txm.wordcloud.feature_1.0.0.202207281752.jar" id="org.txm.wordcloud.feature" version="1.0.0.202207281752"/> |
|
14 |
<feature url="features/org.txm.xmleditor.feature_1.0.0.202207281752.jar" id="org.txm.xmleditor.feature" version="1.0.0.202207281752"/> |
|
15 |
<feature url="features/org.txm.udpipe.feature_1.0.0.202207281752.jar" id="org.txm.udpipe.feature" version="1.0.0.202207281752"/> |
|
16 |
<feature url="features/org.txm.treesearch.feature_1.0.0.202207281752.jar" id="org.txm.treesearch.feature" version="1.0.0.202207281752"/> |
|
6 |
<feature url="features/org.txm.annotation.urs.feature_1.0.0.202212151512.jar" id="org.txm.annotation.urs.feature" version="1.0.0.202212151512"/> |
|
7 |
<feature url="features/org.txm.backtomedia.feature_1.0.0.202212151512.jar" id="org.txm.backtomedia.feature" version="1.0.0.202212151512"/> |
|
8 |
<feature url="features/org.txm.dictionary.feature_1.0.0.202212151512.jar" id="org.txm.dictionary.feature" version="1.0.0.202212151512"/> |
|
9 |
<feature url="features/org.txm.oriflamms.feature_1.0.0.202212151512.jar" id="org.txm.oriflamms.feature" version="1.0.0.202212151512"/> |
|
10 |
<feature url="features/org.txm.svn.feature_1.0.0.202212151512.jar" id="org.txm.svn.feature" version="1.0.0.202212151512"/> |
|
11 |
<feature url="features/org.txm.textsbalance.feature_1.0.0.202212151512.jar" id="org.txm.textsbalance.feature" version="1.0.0.202212151512"/> |
|
12 |
<feature url="features/org.txm.translate.feature_1.0.0.202212151512.jar" id="org.txm.translate.feature" version="1.0.0.202212151512"/> |
|
13 |
<feature url="features/org.txm.wordcloud.feature_1.0.0.202212151512.jar" id="org.txm.wordcloud.feature" version="1.0.0.202212151512"/> |
|
14 |
<feature url="features/org.txm.xmleditor.feature_1.0.0.202212151512.jar" id="org.txm.xmleditor.feature" version="1.0.0.202212151512"/> |
|
15 |
<feature url="features/org.txm.udpipe.feature_1.0.0.202212151512.jar" id="org.txm.udpipe.feature" version="1.0.0.202212151512"/> |
|
16 |
<feature url="features/org.txm.treesearch.feature_1.0.0.202212151512.jar" id="org.txm.treesearch.feature" version="1.0.0.202212151512"/> |
|
17 |
<feature url="features/org.txm.texts.feature_1.0.0.202212151512.jar" id="org.txm.texts.feature" version="1.0.0.202212151512"/> |
|
17 | 18 |
</site> |
TXM/trunk/org.txm.texts.rcp/src/org/txm/texts/rcp/TextsViewEditor.java (revision 3582) | ||
---|---|---|
13 | 13 |
import org.eclipse.jface.viewers.StructuredSelection; |
14 | 14 |
import org.eclipse.jface.viewers.TableViewer; |
15 | 15 |
import org.eclipse.jface.viewers.TableViewerColumn; |
16 |
import org.eclipse.jface.viewers.Viewer; |
|
16 | 17 |
import org.eclipse.jface.viewers.ViewerComparator; |
17 | 18 |
import org.eclipse.swt.SWT; |
18 | 19 |
import org.eclipse.swt.graphics.Image; |
... | ... | |
20 | 21 |
import org.eclipse.swt.layout.GridLayout; |
21 | 22 |
import org.eclipse.swt.widgets.Label; |
22 | 23 |
import org.eclipse.swt.widgets.TableColumn; |
24 |
import org.txm.Toolbox; |
|
23 | 25 |
import org.txm.core.results.Parameter; |
24 | 26 |
import org.txm.edition.rcp.handlers.OpenEdition; |
25 | 27 |
import org.txm.objects.Text; |
26 | 28 |
import org.txm.rcp.IImageKeys; |
27 | 29 |
import org.txm.rcp.editors.TXMEditor; |
28 | 30 |
import org.txm.rcp.editors.TableKeyListener; |
31 |
import org.txm.rcp.editors.TableLinesViewerComparator; |
|
29 | 32 |
import org.txm.rcp.editors.listeners.ComputeSelectionListener; |
30 | 33 |
import org.txm.rcp.swt.widget.PropertiesSelector; |
31 | 34 |
import org.txm.searchengine.cqp.corpus.StructuralUnitProperty; |
... | ... | |
42 | 45 |
|
43 | 46 |
TableViewer viewer; |
44 | 47 |
// HashMap<String, TableViewerColumn> columns = new HashMap<String, TableViewerColumn>(); |
48 |
|
|
49 |
private TableLinesViewerComparator viewerComparator; |
|
45 | 50 |
|
46 | 51 |
@Override |
47 | 52 |
public void _createPartControl() throws Exception { |
... | ... | |
70 | 75 |
gdata.minimumWidth = 300; |
71 | 76 |
negativeFiltersText.setLayoutData(gdata); |
72 | 77 |
|
73 |
viewer = new TableViewer(this.getResultArea(), SWT.NONE);
|
|
78 |
viewer = new TableViewer(this.getResultArea(), SWT.VIRTUAL);
|
|
74 | 79 |
viewer.getTable().setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true)); |
75 | 80 |
viewer.getTable().setHeaderVisible(true); |
76 | 81 |
viewer.getTable().setLinesVisible(true); |
77 | 82 |
viewer.getTable().addKeyListener(new TableKeyListener(viewer)); |
78 | 83 |
|
84 |
viewerComparator = new TableLinesViewerComparator(Toolbox.getCollator(this.getResult())) { |
|
85 |
@Override |
|
86 |
public int compare(Viewer viewer, Object e1, Object e2) { |
|
87 |
|
|
88 |
Text t1 = (Text)e1; |
|
89 |
Text t2 = (Text)e2; |
|
90 |
int c = 0; |
|
91 |
switch (this.lastColumnIndex) { |
|
92 |
case 0: // name |
|
93 |
c = collator.compare(t1.getName(), t2.getName()); |
|
94 |
break; |
|
95 |
case 1: // edition |
|
96 |
c = t1.getEditions().size() - t2.getEditions().size(); |
|
97 |
break; |
|
98 |
case 2: // separator |
|
99 |
break; |
|
100 |
default: |
|
101 |
//System.out.println("v1="+getResult().getLines().get(t1.getName()).get(this.lastColumnIndex-3)+ " v2="+getResult().getLines().get(t2.getName()).get(this.lastColumnIndex-3)); |
|
102 |
String v1 = getResult().getLines().get(t1.getName()).get(this.lastColumnIndex-3); |
|
103 |
String v2 = getResult().getLines().get(t2.getName()).get(this.lastColumnIndex-3); |
|
104 |
// try { |
|
105 |
// return Integer.parseInt(v1) - Integer.parseInt(v2); |
|
106 |
// } catch (Exception e) { |
|
107 |
// // TODO: handle exception |
|
108 |
// } |
|
109 |
// try { |
|
110 |
// return Toolbox.dateformat.parse(v1).compareTo(Toolbox.dateformat.parse(v2)); |
|
111 |
// } catch (Exception e) { |
|
112 |
// // TODO: handle exception |
|
113 |
// } |
|
114 |
c = collator.compare(v1, v2); |
|
115 |
} |
|
116 |
if (this.direction == DESCENDING) { |
|
117 |
c = -c; |
|
118 |
} |
|
119 |
return c; |
|
120 |
} |
|
121 |
}; |
|
122 |
viewer.setComparator(viewerComparator); |
|
123 |
|
|
79 | 124 |
viewer.setContentProvider(new IStructuredContentProvider() { |
80 | 125 |
|
81 | 126 |
@SuppressWarnings("rawtypes") |
... | ... | |
91 | 136 |
|
92 | 137 |
}); |
93 | 138 |
|
94 |
viewer.setComparator(new ViewerComparator()); |
|
95 |
|
|
96 | 139 |
} |
97 | 140 |
|
98 | 141 |
@Override |
... | ... | |
103 | 146 |
@Override |
104 | 147 |
public void updateEditorFromResult(boolean update) throws Exception { |
105 | 148 |
|
106 |
|
|
107 | 149 |
TextsView tv = getResult(); |
108 | 150 |
int currentDisplayedColumns = viewer.getTable().getColumns().length; |
109 | 151 |
int numberOfColumnsToDisplay = (tv.getColumns().size() + 3); |
... | ... | |
128 | 170 |
return text.getName(); |
129 | 171 |
} |
130 | 172 |
}); |
173 |
viewerComparator.addSelectionAdapter(viewer, textColumn, 0); |
|
131 | 174 |
|
132 | 175 |
c = new TableViewerColumn(viewer, SWT.NONE); |
133 | 176 |
TableColumn editionColumn = c.getColumn(); |
... | ... | |
150 | 193 |
return null; |
151 | 194 |
} |
152 | 195 |
}); |
196 |
viewerComparator.addSelectionAdapter(viewer, editionColumn, 1); |
|
153 | 197 |
|
154 | 198 |
c = new TableViewerColumn(viewer, SWT.NONE); |
155 | 199 |
TableColumn separatorColumn = c.getColumn(); |
... | ... | |
162 | 206 |
return ""; |
163 | 207 |
} |
164 | 208 |
}); |
209 |
viewerComparator.addSelectionAdapter(viewer, separatorColumn, 2); |
|
165 | 210 |
|
166 | 211 |
int nColumn = 0; |
167 | 212 |
for (StructuralUnitProperty col : this.getResult().getColumns()) { |
... | ... | |
171 | 216 |
newColumn.setData(nColumn); |
172 | 217 |
newColumn.setToolTipText(col.getFullName()); |
173 | 218 |
newColumn.setWidth(100); |
219 |
viewerComparator.addSelectionAdapter(viewer, newColumn, 3+nColumn); |
|
174 | 220 |
c.setLabelProvider(new TextViewColumnLabelProvider(this, nColumn)); |
175 | 221 |
nColumn++; |
176 | 222 |
} |
TXM/trunk/org.txm.conllu.core/groovy/org/txm/scripts/importer/conllu/CoNLLUImporter.groovy (revision 3582) | ||
---|---|---|
2 | 2 |
|
3 | 3 |
import org.txm.Toolbox |
4 | 4 |
import org.txm.importer.xtz.ImportModule; |
5 |
import org.txm.metadatas.Metadata |
|
5 | 6 |
import org.txm.metadatas.Metadatas |
6 | 7 |
import org.txm.utils.io.FileCopy |
7 | 8 |
import org.txm.utils.io.IOUtils |
... | ... | |
46 | 47 |
return; |
47 | 48 |
} |
48 | 49 |
} |
50 |
File metadataFile = Metadatas.findMetadataFile(inputDirectory) |
|
49 | 51 |
File srcDirectory = new File(outputDirectory.getParentFile().getParentFile(), "conllu2tei") |
50 | 52 |
srcDirectory.deleteDir(); |
51 | 53 |
srcDirectory.mkdirs(); |
52 | 54 |
|
55 |
if (metadataFile.exists()) { |
|
56 |
File metadataFile2 = new File(srcDirectory, metadataFile.getName()) |
|
57 |
FileCopy.copy(metadataFile, metadataFile2) |
|
58 |
} |
|
59 |
|
|
53 | 60 |
println "Convert CoNLL-U to XML-TEI..." |
54 | 61 |
convertCoNLLU2TEI(conlluSrcDirectory, srcDirectory, project) |
55 | 62 |
|
TXM/trunk/org.txm.conllu.core/groovy/org/txm/scripts/importer/conllu/CoNLLUImport.groovy (revision 3582) | ||
---|---|---|
33 | 33 |
super.init(p); |
34 | 34 |
|
35 | 35 |
importer = new CoNLLUImporter(this); |
36 |
compiler = new XTZCompiler(this) |
|
37 |
annotater = null; // no annotater step to do |
|
38 |
pager = new XTZPager(this) |
|
36 |
// compiler = new XTZCompiler(this)
|
|
37 |
// annotater = null; // no annotater step to do
|
|
38 |
// pager = new XTZPager(this)
|
|
39 | 39 |
} |
40 | 40 |
|
41 | 41 |
/** |
... | ... | |
44 | 44 |
@Override |
45 | 45 |
public void start() throws InterruptedException { |
46 | 46 |
|
47 |
this.project.setDoTokenizerStep(false) |
|
48 |
|
|
47 | 49 |
super.start(); // call the usual XTZ import |
48 | 50 |
|
49 | 51 |
// build the TIGER-XML file |
TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/editors/imports/sections/WordsSection.java (revision 3582) | ||
---|---|---|
368 | 368 |
project.addTokenizerParameter("punct_strong", textPunctsStrong.getText()); //$NON-NLS-1$ |
369 | 369 |
project.addTokenizerParameter("regElision", textElisions.getText()); //$NON-NLS-1$ |
370 | 370 |
project.addTokenizerParameter("word_tags", wordElementText.getText()); //$NON-NLS-1$ |
371 |
project.addTokenizerParameter("doTokenizeStep", "" + doTokenizeStepButton.getSelection()); //$NON-NLS-1$ //$NON-NLS-2$
|
|
371 |
project.setDoTokenizerStep(doTokenizeStepButton.getSelection());
|
|
372 | 372 |
project.addTokenizerParameter("doRetokenizeStep", "" + doRetokenizeStepButton.getSelection()); //$NON-NLS-1$ //$NON-NLS-2$ |
373 | 373 |
project.addTokenizerParameter("doBuildWordIds", "" + doBuildWordIDsButton.getSelection()); //$NON-NLS-1$ //$NON-NLS-2$ |
374 | 374 |
project.addTokenizerParameter("onlyThoseTests", "false"); //$NON-NLS-1$ //$NON-NLS-2$ |
Formats disponibles : Unified diff