Révision 1002
| tmp/org.txm.analec.rcp/src/org/txm/analec/toolbar/UnitToolbar.java (revision 1002) | ||
|---|---|---|
| 97 | 97 |
@Override |
| 98 | 98 |
public boolean install(TXMEditor<? extends TXMResult> txmeditor, AnnotationExtension extension, Composite parent, int position) throws Exception {
|
| 99 | 99 |
super.install(txmeditor, extension, parent, position); |
| 100 |
|
|
| 100 |
|
|
| 101 | 101 |
annotationArea.getLayout().numColumns = 10; |
| 102 | 102 |
annotationArea.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false)); |
| 103 | 103 |
|
| ... | ... | |
| 612 | 612 |
if (unites == null) return; |
| 613 | 613 |
|
| 614 | 614 |
try {
|
| 615 |
Page page = editor.getEditionPanel(0).getCurrentPage(); |
|
| 616 |
Edition e = page.getEdition(); |
|
| 617 |
Page next = e.getNextPage(page); |
|
| 618 |
int first_ids[] = CQPSearchEngine.getCqiClient().str2Id(maincorpus.getProperty("id").getQualifiedName(), new String[] {page.getWordId()}); //$NON-NLS-1$
|
|
| 619 |
|
|
| 620 |
int last_ids[] = null; |
|
| 621 |
if (next != null && next != page) {
|
|
| 622 |
last_ids = CQPSearchEngine.getCqiClient().str2Id(maincorpus.getProperty("id").getQualifiedName(), new String[] {next.getWordId()}); //$NON-NLS-1$
|
|
| 623 |
} |
|
| 624 |
|
|
| 625 |
int first_pos = CQPSearchEngine.getCqiClient().id2Cpos(maincorpus.getProperty("id").getQualifiedName(), first_ids[0])[0];
|
|
| 626 |
int last_pos = Integer.MAX_VALUE; |
|
| 627 |
if (last_ids != null) {
|
|
| 628 |
last_pos = CQPSearchEngine.getCqiClient().id2Cpos(maincorpus.getProperty("id").getQualifiedName(), last_ids[0])[0];
|
|
| 629 |
} |
|
| 630 |
|
|
| 631 |
int n2 = 0; |
|
| 632 |
for (int i = 0 ; i < unites.length ; i++) {
|
|
| 633 |
for (int p = unites[i].getDeb() ; p <= unites[i].getFin() ; p++) {
|
|
| 634 |
if (p >= first_pos && p <= last_pos) {
|
|
| 635 |
n2++; |
|
| 615 |
Page page = editor.getEditionPanel(0).getCurrentPage(); |
|
| 616 |
Edition e = page.getEdition(); |
|
| 617 |
Page next = e.getNextPage(page); |
|
| 618 |
String id = page.getWordId(); |
|
| 619 |
if (id == null || id.length() == 0) return; |
|
| 620 |
|
|
| 621 |
int first_ids[] = CQPSearchEngine.getCqiClient().str2Id(maincorpus.getProperty("id").getQualifiedName(), new String[] {id}); //$NON-NLS-1$
|
|
| 622 |
|
|
| 623 |
if (first_ids.length == 0) return; |
|
| 624 |
int first_id = first_ids[0]; |
|
| 625 |
if (first_id == -1) return; |
|
| 626 |
|
|
| 627 |
int last_ids[] = null; |
|
| 628 |
if (next != null && next != page) {
|
|
| 629 |
String next_id = next.getWordId(); |
|
| 630 |
last_ids = CQPSearchEngine.getCqiClient().str2Id(maincorpus.getProperty("id").getQualifiedName(), new String[] {next_id}); //$NON-NLS-1$
|
|
| 631 |
} |
|
| 632 |
|
|
| 633 |
int first_pos = CQPSearchEngine.getCqiClient().id2Cpos(maincorpus.getProperty("id").getQualifiedName(), first_id)[0];
|
|
| 634 |
int last_pos = Integer.MAX_VALUE; |
|
| 635 |
if (last_ids != null && last_ids.length > 0) {
|
|
| 636 |
last_pos = CQPSearchEngine.getCqiClient().id2Cpos(maincorpus.getProperty("id").getQualifiedName(), last_ids[0])[0];
|
|
| 637 |
} |
|
| 638 |
|
|
| 639 |
int n2 = 0; |
|
| 640 |
for (int i = 0 ; i < unites.length ; i++) {
|
|
| 641 |
for (int p = unites[i].getDeb() ; p <= unites[i].getFin() ; p++) {
|
|
| 642 |
if (p >= first_pos && p <= last_pos) {
|
|
| 643 |
n2++; |
|
| 644 |
} |
|
| 636 | 645 |
} |
| 637 | 646 |
} |
| 638 |
} |
|
| 639 |
|
|
| 640 |
int allpositions[] = new int[n2];
|
|
| 641 |
n2 = 0;
|
|
| 642 |
for (int i = 0 ; i < unites.length ; i++) {
|
|
| 643 |
for (int p = unites[i].getDeb() ; p <= unites[i].getFin() ; p++) {
|
|
| 644 |
if (p >= first_pos && p <= last_pos) {
|
|
| 645 |
allpositions[n2++] = p;
|
|
| 647 |
|
|
| 648 |
int allpositions[] = new int[n2]; |
|
| 649 |
n2 = 0;
|
|
| 650 |
for (int i = 0 ; i < unites.length ; i++) {
|
|
| 651 |
for (int p = unites[i].getDeb() ; p <= unites[i].getFin() ; p++) {
|
|
| 652 |
if (p >= first_pos && p <= last_pos) {
|
|
| 653 |
allpositions[n2++] = p;
|
|
| 654 |
}
|
|
| 646 | 655 |
} |
| 647 | 656 |
} |
| 648 |
} |
|
| 649 | 657 |
|
| 650 |
|
|
| 651 | 658 |
if (previousSelectedTypeUnitIDS != null) {
|
| 652 | 659 |
editor.removeHighlightWordsById(highlighted_unit_color, previousSelectedTypeUnitIDS); |
| 653 | 660 |
editor.removeFontWeightWordsById(previousSelectedTypeUnitIDS); |
| ... | ... | |
| 1154 | 1161 |
if (pageProgressListener != null) {
|
| 1155 | 1162 |
return pageProgressListener; |
| 1156 | 1163 |
} |
| 1157 |
|
|
| 1164 |
|
|
| 1158 | 1165 |
pageProgressListener = new ProgressListener() {
|
| 1159 |
|
|
| 1166 |
|
|
| 1160 | 1167 |
@Override |
| 1161 | 1168 |
public void completed(ProgressEvent event) {
|
| 1162 | 1169 |
if (typeCombo.getSelectionIndex() >= 0) {
|
| 1163 | 1170 |
highlightType(); |
| 1164 | 1171 |
} |
| 1165 | 1172 |
} |
| 1166 |
|
|
| 1173 |
|
|
| 1167 | 1174 |
@Override |
| 1168 | 1175 |
public void changed(ProgressEvent event) { }
|
| 1169 | 1176 |
}; |
| tmp/org.txm.rcp/src/main/java/org/txm/rcp/views/fileexplorer/Explorer.java (revision 1002) | ||
|---|---|---|
| 77 | 77 |
static public String ID = "org.txm.rcp.views.fileexplorer.Explorer"; //$NON-NLS-1$ |
| 78 | 78 |
|
| 79 | 79 |
/** Initialize currentPath with user home directory */ |
| 80 |
private String currentPath = System.getProperty("user.home");//Toolbox.getTXMHOMEPATH(); //$NON-NLS-1$
|
|
| 80 |
private String currentPath = System.getProperty("user.home");//Toolbox.getTxmHomePath(); //$NON-NLS-1$
|
|
| 81 | 81 |
|
| 82 | 82 |
/** The tv. */ |
| 83 | 83 |
TreeViewer tv; |
| ... | ... | |
| 298 | 298 |
File txmhome = new File(Toolbox.getTxmHomePath()); |
| 299 | 299 |
File scripts = new File(Toolbox.getTxmHomePath(), "scripts"); //$NON-NLS-1$ |
| 300 | 300 |
File corpora = new File(Toolbox.getTxmHomePath(), "corpora"); //$NON-NLS-1$ |
| 301 |
//File registry = new File(Toolbox.getTXMHOMEPATH(), "registry"); //$NON-NLS-1$
|
|
| 301 |
//File registry = new File(Toolbox.getTxmHomePath(), "registry"); //$NON-NLS-1$
|
|
| 302 | 302 |
File workspaces = new File(Toolbox.getTxmHomePath(), "workspaces"); //$NON-NLS-1$ |
| 303 | 303 |
File xsl = new File(Toolbox.getTxmHomePath(), "xsl"); //$NON-NLS-1$ |
| 304 | 304 |
File samples = new File(Toolbox.getTxmHomePath(), "samples"); //$NON-NLS-1$ |
| tmp/org.txm.rcp/src/main/java/org/txm/rcp/views/fileexplorer/MacroExplorer.java (revision 1002) | ||
|---|---|---|
| 284 | 284 |
File txmhome = new File(Toolbox.getTxmHomePath()); |
| 285 | 285 |
File scripts = new File(Toolbox.getTxmHomePath(), "scripts"); //$NON-NLS-1$ |
| 286 | 286 |
File corpora = new File(Toolbox.getTxmHomePath(), "corpora"); //$NON-NLS-1$ |
| 287 |
//File registry = new File(Toolbox.getTXMHOMEPATH(), "registry"); //$NON-NLS-1$
|
|
| 287 |
//File registry = new File(Toolbox.getTxmHomePath(), "registry"); //$NON-NLS-1$
|
|
| 288 | 288 |
File workspaces = new File(Toolbox.getTxmHomePath(), "workspaces"); //$NON-NLS-1$ |
| 289 | 289 |
File xsl = new File(Toolbox.getTxmHomePath(), "xsl"); //$NON-NLS-1$ |
| 290 | 290 |
File samples = new File(Toolbox.getTxmHomePath(), "samples"); //$NON-NLS-1$ |
| tmp/org.txm.rcp/src/main/java/org/txm/rcp/commands/workspace/LoadBinaryCorpus.java (revision 1002) | ||
|---|---|---|
| 286 | 286 |
return null; |
| 287 | 287 |
} |
| 288 | 288 |
|
| 289 |
//File txmregistry = new File(Toolbox.getTXMHOMEPATH(), "registry"); //$NON-NLS-1$
|
|
| 289 |
//File txmregistry = new File(Toolbox.getTxmHomePath(), "registry"); //$NON-NLS-1$
|
|
| 290 | 290 |
//txmregistry.mkdir(); |
| 291 | 291 |
File txmcorpora = new File(Toolbox.getTxmHomePath(), "corpora"); //$NON-NLS-1$ |
| 292 | 292 |
txmcorpora.mkdir(); |
| tmp/org.txm.rcp/src/main/java/org/txm/rcp/handlers/export/ExportResult.java (revision 1002) | ||
|---|---|---|
| 78 | 78 |
final Object s = selection.getFirstElement(); |
| 79 | 79 |
Shell shell = HandlerUtil.getActiveWorkbenchWindowChecked(event).getShell(); |
| 80 | 80 |
|
| 81 |
//String txmhome = Toolbox.getTXMHOMEPATH();
|
|
| 81 |
//String txmhome = Toolbox.getTxmHomePath();
|
|
| 82 | 82 |
FileDialog dialog = new FileDialog(shell, SWT.SAVE); |
| 83 | 83 |
|
| 84 | 84 |
String extensions[] = {"*.csv"}; //$NON-NLS-1$
|
| tmp/org.txm.rcp/src/main/java/org/txm/rcp/handlers/export/ExportSVG.java (revision 1002) | ||
|---|---|---|
| 61 | 61 |
// System.out.println(Messages.ExportSVG_0); |
| 62 | 62 |
// Shell shell = HandlerUtil.getActiveWorkbenchWindowChecked(event).getShell(); |
| 63 | 63 |
// |
| 64 |
// String txmhome = Toolbox.getTXMHOMEPATH();
|
|
| 64 |
// String txmhome = Toolbox.getTxmHomePath();
|
|
| 65 | 65 |
// |
| 66 | 66 |
// // get editor |
| 67 | 67 |
// IWorkbenchPart page = HandlerUtil.getActiveWorkbenchWindow(event) |
| tmp/org.txm.treetagger.rcp/src/org/txm/treetagger/rcp/handlers/LemmaProjection.java (revision 1002) | ||
|---|---|---|
| 254 | 254 |
|
| 255 | 255 |
// update corpus |
| 256 | 256 |
// update corpus indexes and edition |
| 257 |
// String txmhome = Toolbox.getTXMHOMEPATH();
|
|
| 257 |
// String txmhome = Toolbox.getTxmHomePath();
|
|
| 258 | 258 |
// |
| 259 | 259 |
// BaseParameters params = corpus.getBase().getBaseParameters(); |
| 260 | 260 |
// params.getKeyValueParameters().put(ImportKeys.MULTITHREAD, "false"); //too soon |
| tmp/org.txm.core/src/java/org/txm/utils/BundleUtils.java (revision 1002) | ||
|---|---|---|
| 38 | 38 |
public static String getBundleLocation(String bundle_id) {
|
| 39 | 39 |
Bundle bundle = Platform.getBundle(bundle_id); |
| 40 | 40 |
if (bundle == null) {
|
| 41 |
//System.out.println("Error while initializing Oriflamms plugin: bundle not found.");
|
|
| 42 | 41 |
return null; |
| 43 | 42 |
} |
| 44 | 43 |
return bundle.getLocation(); |
| ... | ... | |
| 53 | 52 |
Log.info("Retrieving file_path from "+bundle_id+" plugin.");
|
| 54 | 53 |
Bundle bundle = Platform.getBundle(bundle_id); |
| 55 | 54 |
if (bundle == null) {
|
| 56 |
System.out.println("Error while initializing Oriflamms plugin: bundle not found.");
|
|
| 55 |
System.out.println("Error while initializing '"+bundle_id+"' plugin: bundle not found.");
|
|
| 57 | 56 |
return null; |
| 58 | 57 |
} |
| 59 | 58 |
String bundleLocation = bundle.getLocation(); |
| ... | ... | |
| 184 | 183 |
public static ClassLoader getLoader(String bundle_id) {
|
| 185 | 184 |
Bundle bundle = Platform.getBundle(bundle_id); |
| 186 | 185 |
if (bundle == null) {
|
| 187 |
System.out.println("Error while initializing Oriflamms plugin: bundle not found.");
|
|
| 186 |
System.out.println("Error while initializing '"+bundle_id+"' plugin: bundle not found.");
|
|
| 188 | 187 |
return null; |
| 189 | 188 |
} |
| 190 | 189 |
|
| tmp/org.txm.setups/shared/debian/usr/bin/TXM (revision 1002) | ||
|---|---|---|
| 150 | 150 |
## uncomment next lien to enable full debug |
| 151 | 151 |
#DEBUGOPTIONS="-log -consolelog -clean -debug -console -noexit" |
| 152 | 152 |
|
| 153 |
UBUNTU_MENUPROXY=0 exec "${TXMINSTALL}/TXM" -run --launcher.ini "$DOTTXMHOME/TXM.ini" $DEBUGOPTIONS -data "$DOTTXMHOME/data" -user "$DOTTXMHOME/user" -install "$TXMINSTALL"
|
|
| 153 |
SWT_GTK3=0 UBUNTU_MENUPROXY=0 exec "${TXMINSTALL}/TXM" -run --launcher.ini "$DOTTXMHOME/TXM.ini" $DEBUGOPTIONS -data "$DOTTXMHOME/data" -user "$DOTTXMHOME/user" -install "$TXMINSTALL"
|
|
| tmp/org.txm.tigersearch.rcp/groovy/org/txm/scripts/importer/tigersearch/TSImport.groovy (revision 1002) | ||
|---|---|---|
| 62 | 62 |
File master = xmlFiles[0]; |
| 63 | 63 |
println "Main TIGER XML file found: $master" |
| 64 | 64 |
|
| 65 |
File tsXSLFile = new File(Toolbox.getTXMHOMEPATH(), "xsl/ts.xsl");
|
|
| 66 |
BundleUtils.copyFiles("TIGERSearchRCP", "src", "org/txm/importer/tigersearch", "ts.xsl", tsXSLFile.getParentFile());
|
|
| 65 |
File tsXSLFile = new File(Toolbox.getTxmHomePath(), "xsl/ts.xsl");
|
|
| 66 |
BundleUtils.copyFiles("org.txm.tigersearch.rcp", "groovy", "org/txm/scripts/importer/tigersearch", "ts.xsl", tsXSLFile.getParentFile());
|
|
| 67 | 67 |
|
| 68 | 68 |
File xmltxmSrcDir = new File(binaryDirectory, "src"); // output directory of the TS XSL transformation |
| 69 | 69 |
xmltxmSrcDir.mkdirs(); |
| tmp/org.txm.tigersearch.rcp/groovy/org/txm/scripts/importer/srcmf/srcmfLoader.groovy (revision 1002) | ||
|---|---|---|
| 81 | 81 |
File tigerSrcDir = new File(rootDir, "tiger-xml"); |
| 82 | 82 |
File headerFile = new File(rootDir, "tiger-xml/header.xml"); |
| 83 | 83 |
|
| 84 |
File binDir = new File(Toolbox.getTXMHOMEPATH(),"corpora/"+basename);
|
|
| 84 |
File binDir = new File(Toolbox.getTxmHomePath(),"corpora/"+basename);
|
|
| 85 | 85 |
|
| 86 | 86 |
binDir.deleteDir(); |
| 87 | 87 |
binDir.mkdirs(); |
| tmp/org.txm.tigersearch.rcp/src/org/txm/function/tigersearch/TIGERSearch.java (revision 1002) | ||
|---|---|---|
| 164 | 164 |
|
| 165 | 165 |
@Override |
| 166 | 166 |
public ImageDescriptor getImageDescriptor(Object object) {
|
| 167 |
return AbstractUIPlugin.imageDescriptorFromPlugin("TIGERSearchRCP", "icons/functions/TS.png"); //$NON-NLS //$NON-NLS-1$
|
|
| 167 |
return AbstractUIPlugin.imageDescriptorFromPlugin("org.txm.tigersearch.rcp", "icons/functions/TS.png"); //$NON-NLS //$NON-NLS-1$
|
|
| 168 | 168 |
} |
| 169 | 169 |
|
| 170 | 170 |
@Override |
| tmp/org.txm.index.core/groovy/org/txm/macro/r/ExecRMacro.groovy (revision 1002) | ||
|---|---|---|
| 26 | 26 |
} |
| 27 | 27 |
|
| 28 | 28 |
def r = RWorkspace.getRWorkspaceInstance() |
| 29 |
def file = File.createTempFile("IndexHist", ".svg", new File(Toolbox.getTXMHOMEPATH(), "results"))
|
|
| 29 |
def file = File.createTempFile("IndexHist", ".svg", new File(Toolbox.getTxmHomePath(), "results"))
|
|
| 30 | 30 |
|
| 31 | 31 |
/// BEGIN SCRIPTS |
| 32 | 32 |
def script =""" |
Formats disponibles : Unified diff