Révision 2108
| tmp/org.txm.groovy.core/src/groovy/org/txm/macro/cqp/ListMatchesMacro.groovy (revision 2108) | ||
|---|---|---|
| 1 |
// STANDARD DECLARATIONS |
|
| 2 |
package org.txm.macroproto.cqp |
|
| 3 |
|
|
| 4 |
import org.kohsuke.args4j.* |
|
| 5 |
import groovy.transform.Field |
|
| 6 |
import org.txm.rcpapplication.swt.widget.parameters.* |
|
| 7 |
import org.txm.Toolbox |
|
| 8 |
import org.txm.searchengine.cqp.* |
|
| 9 |
import org.txm.searchengine.cqp.corpus.* |
|
| 10 |
import org.txm.utils.* |
|
| 11 |
|
|
| 12 |
if (!(corpusViewSelection instanceof Corpus)) {
|
|
| 13 |
println "Selection is not a Corpus: $corpusViewSelection" |
|
| 14 |
return false |
|
| 15 |
} |
|
| 16 |
|
|
| 17 |
println corpusViewSelection.getMatches() |
|
| tmp/TXMReleasePlugins.site/site.xml (revision 2108) | ||
|---|---|---|
| 3 | 3 |
<description name="TXM Extensions - RELEASE" url="http://txm.textometrie.org/updates/plugins"> |
| 4 | 4 |
This update site contains the Release plugins for TXM |
| 5 | 5 |
</description> |
| 6 |
<feature url="features/org.txm.backtomedia.feature_1.0.0.201905221522.jar" id="org.txm.backtomedia.feature" version="1.0.0.201905221522">
|
|
| 6 |
<feature url="features/org.txm.backtomedia.feature_1.0.0.201905241540.jar" id="org.txm.backtomedia.feature" version="1.0.0.201905241540">
|
|
| 7 | 7 |
<category name="Commands"/> |
| 8 | 8 |
</feature> |
| 9 |
<feature url="features/org.txm.wordcloud.feature_1.0.0.201905221522.jar" id="org.txm.wordcloud.feature" version="1.0.0.201905221522">
|
|
| 9 |
<feature url="features/org.txm.wordcloud.feature_1.0.0.201905241540.jar" id="org.txm.wordcloud.feature" version="1.0.0.201905241540">
|
|
| 10 | 10 |
<category name="Commands"/> |
| 11 | 11 |
</feature> |
| 12 |
<feature url="features/org.txm.treetagger.binaries.feature_1.0.0.201905221522.jar" id="org.txm.treetagger.binaries.feature" version="1.0.0.201905221522" os="" ws="">
|
|
| 12 |
<feature url="features/org.txm.treetagger.binaries.feature_1.0.0.201905241540.jar" id="org.txm.treetagger.binaries.feature" version="1.0.0.201905241540" os="" ws="">
|
|
| 13 | 13 |
<category name="Annotation"/> |
| 14 | 14 |
</feature> |
| 15 |
<feature url="features/org.txm.treetagger.models.feature_1.0.0.201905221522.jar" id="org.txm.treetagger.models.feature" version="1.0.0.201905221522">
|
|
| 15 |
<feature url="features/org.txm.treetagger.models.feature_1.0.0.201905241540.jar" id="org.txm.treetagger.models.feature" version="1.0.0.201905241540">
|
|
| 16 | 16 |
<category name="Annotation"/> |
| 17 | 17 |
</feature> |
| 18 |
<feature url="features/org.txm.annotation.urs.feature_1.0.0.201905221522.jar" id="org.txm.annotation.urs.feature" version="1.0.0.201905221522">
|
|
| 18 |
<feature url="features/org.txm.annotation.urs.feature_1.0.0.201905241540.jar" id="org.txm.annotation.urs.feature" version="1.0.0.201905241540">
|
|
| 19 | 19 |
<category name="Annotation"/> |
| 20 | 20 |
</feature> |
| 21 |
<feature url="features/org.txm.tigersearch.feature_1.0.0.201905221522.jar" id="org.txm.tigersearch.feature" version="1.0.0.201905221522">
|
|
| 21 |
<feature url="features/org.txm.tigersearch.feature_1.0.0.201905241540.jar" id="org.txm.tigersearch.feature" version="1.0.0.201905241540">
|
|
| 22 | 22 |
<category name="Annotation"/> |
| 23 | 23 |
</feature> |
| 24 | 24 |
<category-def name="Commands" label="Commands"> |
| tmp/org.txm.concordance.rcp/src/org/txm/concordance/rcp/preferences/ConcordancePreferencePage.java (revision 2108) | ||
|---|---|---|
| 54 | 54 |
this.addField(new IntegerFieldEditor(ConcordancePreferences.LEFT_CONTEXT_SIZE, ConcordanceUIMessages.ampLeftContextLengthInWords, this.getFieldEditorParent())); |
| 55 | 55 |
this.addField(new IntegerFieldEditor(ConcordancePreferences.RIGHT_CONTEXT_SIZE, ConcordanceUIMessages.ampRightContextLengthInWords, this.getFieldEditorParent())); |
| 56 | 56 |
} |
| 57 |
|
|
| 58 |
|
|
| 59 | 57 |
|
| 60 | 58 |
@Override |
| 61 | 59 |
public void init(IWorkbench workbench) {
|
| tmp/org.txm.concordance.rcp/src/org/txm/concordance/rcp/editors/ConcordanceEditor.java (revision 2108) | ||
|---|---|---|
| 1257 | 1257 |
} |
| 1258 | 1258 |
|
| 1259 | 1259 |
JobsTimer.stopAndPrint(); |
| 1260 |
|
|
| 1261 | 1260 |
} |
| 1262 | 1261 |
catch (Exception e1) {
|
| 1263 | 1262 |
Log.severe(NLS.bind(ConcordanceUIMessages.errorWhileComputingTheConcordanceColonP0, Log.toString(e1))); |
| tmp/org.txm.searchengine.cqp.feature/build.properties (revision 2108) | ||
|---|---|---|
| 1 | 1 |
#Fri Jul 06 10:25:16 CEST 2018 |
| 2 |
bin.includes=feature.xml |
|
| 3 |
qualifier=svn |
|
| 2 |
bin.includes=feature.xml |
|
| tmp/org.txm.annotation.kr.rcp/src/org/txm/annotation/kr/rcp/messages/messages.properties (revision 2108) | ||
|---|---|---|
| 33 | 33 |
noValueFoundWithTheP0Id=No value found with the {0} identifier.
|
| 34 | 34 |
oK=OK |
| 35 | 35 |
openTheListOfCategories=Open the list of categories |
| 36 |
pleaseEnterTheNewTypeName=Enter the name of the new type
|
|
| 36 |
pleaseEnterTheNewTypeName=Enter the name of the new category
|
|
| 37 | 37 |
proceedToAnnotation=Proceed to annotation |
| 38 | 38 |
property=Property |
| 39 | 39 |
saveTheAnnotations=Save the annotations |
| tmp/org.txm.annotation.kr.rcp/src/org/txm/annotation/kr/rcp/messages/messages_fr.properties (revision 2108) | ||
|---|---|---|
| 33 | 33 |
noValueFoundWithTheP0Id=Aucune valeur trouvée avec l''identifiant {0}.
|
| 34 | 34 |
oK=OK |
| 35 | 35 |
openTheListOfCategories=Ouvrir la liste de catégories |
| 36 |
pleaseEnterTheNewTypeName=Entrer le nom du nouveau type
|
|
| 36 |
pleaseEnterTheNewTypeName=Entrer le nom de la nouvelle catégorie
|
|
| 37 | 37 |
proceedToAnnotation=Passer à l'annotation |
| 38 | 38 |
property=Propriété |
| 39 | 39 |
saveTheAnnotations=Enregistrer les annotations |
| tmp/org.txm.annotation.kr.rcp/src/org/txm/annotation/kr/rcp/concordance/KRAnnotation.java (revision 2108) | ||
|---|---|---|
| 389 | 389 |
id = baseid+"_"+(c++); //$NON-NLS-1$ |
| 390 | 390 |
} |
| 391 | 391 |
AnnotationType type = kr.addType(name, id, ""); //$NON-NLS-1$ |
| 392 |
type.setEffect(AnnotationEffect.SEGMENT); |
|
| 392 | 393 |
typesList.add(type); |
| 393 | 394 |
|
| 394 | 395 |
if (annotationTypesCombo != null) annotationTypesCombo.refresh(); |
| tmp/org.txm.annotation.kr.rcp/src/org/txm/annotation/kr/rcp/concordance/WordAnnotationToolbar.java (revision 2108) | ||
|---|---|---|
| 37 | 37 |
import org.eclipse.swt.widgets.Label; |
| 38 | 38 |
import org.eclipse.swt.widgets.TableColumn; |
| 39 | 39 |
import org.eclipse.swt.widgets.Text; |
| 40 |
import org.eclipse.ui.dialogs.ListDialog; |
|
| 40 | 41 |
import org.txm.annotation.kr.core.Annotation; |
| 41 | 42 |
import org.txm.annotation.kr.core.AnnotationManager; |
| 42 | 43 |
import org.txm.annotation.kr.core.CQPAnnotation; |
| ... | ... | |
| 51 | 52 |
import org.txm.annotation.kr.rcp.commands.InitializeKnowledgeRepository; |
| 52 | 53 |
import org.txm.annotation.kr.rcp.commands.SaveAnnotations; |
| 53 | 54 |
import org.txm.annotation.kr.rcp.messages.KRAnnotationUIMessages; |
| 55 |
import org.txm.annotation.kr.rcp.views.knowledgerepositories.KRView; |
|
| 54 | 56 |
import org.txm.annotation.rcp.editor.AnnotationArea; |
| 55 | 57 |
import org.txm.annotation.rcp.editor.AnnotationExtension; |
| 56 | 58 |
import org.txm.concordance.core.functions.Concordance; |
| 57 | 59 |
import org.txm.concordance.core.functions.Line; |
| 58 | 60 |
import org.txm.concordance.rcp.editors.ConcordanceEditor; |
| 59 | 61 |
import org.txm.concordance.rcp.editors.ConcordanceEditor.ConcordanceColumnSizeControlListener; |
| 62 |
import org.txm.concordance.rcp.messages.ConcordanceUIMessages; |
|
| 60 | 63 |
import org.txm.core.messages.TXMCoreMessages; |
| 61 | 64 |
import org.txm.core.results.TXMResult; |
| 62 | 65 |
import org.txm.objects.Match; |
| ... | ... | |
| 121 | 124 |
private TableViewerColumn annotationColumnViewer; |
| 122 | 125 |
private Font annotationColummnFont; |
| 123 | 126 |
private Font defaultColummnFont; |
| 127 |
private Button addAnnotationTypeLink; |
|
| 128 |
private Button addTypedValueLink; |
|
| 124 | 129 |
|
| 125 | 130 |
public String getName() {
|
| 126 | 131 |
return KRAnnotationUIMessages.motsPropritsInfDfaut; |
| ... | ... | |
| 480 | 485 |
|
| 481 | 486 |
annotationArea = new GLComposite(parent, SWT.NONE, KRAnnotationUIMessages.concordanceAnnotationArea); |
| 482 | 487 |
annotationArea.getLayout().numColumns = 12; |
| 488 |
annotationArea.getLayout().horizontalSpacing = 2; |
|
| 483 | 489 |
annotationArea.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); |
| 484 | 490 |
|
| 485 | 491 |
GridData gdata = new GridData(SWT.CENTER, SWT.CENTER, false, false); |
| 486 | 492 |
gdata.widthHint = 90; |
| 487 | 493 |
|
| 494 |
new Label(annotationArea, SWT.NONE).setText(TXMCoreMessages.common_property); |
|
| 495 |
|
|
| 488 | 496 |
//Display combo with list of Annotation Type |
| 489 |
annotationTypesCombo = new ComboViewer(annotationArea, SWT.SINGLE);
|
|
| 497 |
annotationTypesCombo = new ComboViewer(annotationArea, SWT.READ_ONLY);
|
|
| 490 | 498 |
annotationTypesCombo.setContentProvider(new ArrayContentProvider()); |
| 491 | 499 |
annotationTypesCombo.setLabelProvider(new SimpleLabelProvider() {
|
| 492 | 500 |
@Override |
| ... | ... | |
| 498 | 506 |
return ((AnnotationType)element).getName(); //$NON-NLS-1$ |
| 499 | 507 |
} |
| 500 | 508 |
}); |
| 501 |
annotationTypesCombo.getCombo().addKeyListener(new KeyListener() {
|
|
| 502 |
|
|
| 503 |
@Override |
|
| 504 |
public void keyReleased(KeyEvent e) {
|
|
| 505 |
if (e.keyCode == SWT.CR || e.keyCode == SWT.KEYPAD_CR) {
|
|
| 506 |
String name = annotationTypesCombo.getCombo().getText(); |
|
| 507 |
if (currentKnowledgeRepository.getType(name) == null) {
|
|
| 508 |
createNewType(e, name); |
|
| 509 |
} else {
|
|
| 510 |
for (AnnotationType type : typesList) {
|
|
| 511 |
if (name.equals(type.getId())) {
|
|
| 512 |
StructuredSelection selection = new StructuredSelection(type); |
|
| 513 |
annotationTypesCombo.setSelection(selection, true); |
|
| 514 |
break; |
|
| 515 |
} |
|
| 516 |
} |
|
| 517 |
} |
|
| 518 |
} |
|
| 519 |
} |
|
| 520 |
|
|
| 521 |
@Override |
|
| 522 |
public void keyPressed(KeyEvent e) { }
|
|
| 523 |
}); |
|
| 509 |
// annotationTypesCombo.getCombo().addKeyListener(new KeyListener() {
|
|
| 510 |
// |
|
| 511 |
// @Override
|
|
| 512 |
// public void keyReleased(KeyEvent e) {
|
|
| 513 |
// if (e.keyCode == SWT.CR || e.keyCode == SWT.KEYPAD_CR) {
|
|
| 514 |
// String name = annotationTypesCombo.getCombo().getText();
|
|
| 515 |
// if (currentKnowledgeRepository.getType(name) == null) {
|
|
| 516 |
// createNewType(e, name);
|
|
| 517 |
// } else {
|
|
| 518 |
// for (AnnotationType type : typesList) {
|
|
| 519 |
// if (name.equals(type.getId())) {
|
|
| 520 |
// StructuredSelection selection = new StructuredSelection(type);
|
|
| 521 |
// annotationTypesCombo.setSelection(selection, true);
|
|
| 522 |
// break;
|
|
| 523 |
// }
|
|
| 524 |
// }
|
|
| 525 |
// }
|
|
| 526 |
// }
|
|
| 527 |
// }
|
|
| 528 |
// |
|
| 529 |
// @Override
|
|
| 530 |
// public void keyPressed(KeyEvent e) { }
|
|
| 531 |
// });
|
|
| 524 | 532 |
|
| 525 | 533 |
gdata = new GridData(SWT.CENTER, SWT.CENTER, false, false); |
| 526 | 534 |
gdata.widthHint = 200; |
| ... | ... | |
| 544 | 552 |
onAnnotationTypeSelected(event); |
| 545 | 553 |
} |
| 546 | 554 |
}); |
| 555 |
|
|
| 556 |
addAnnotationTypeLink = new Button(annotationArea, SWT.PUSH); |
|
| 557 |
addAnnotationTypeLink.setToolTipText(KRAnnotationUIMessages.addANewCategory); |
|
| 558 |
addAnnotationTypeLink.setImage(IImageKeys.getImage(IImageKeys.ACTION_ADD)); |
|
| 559 |
addAnnotationTypeLink.setEnabled(true); |
|
| 560 |
addAnnotationTypeLink.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false)); |
|
| 561 |
addAnnotationTypeLink.addSelectionListener(new SelectionListener() {
|
|
| 562 |
@Override |
|
| 563 |
public void widgetSelected(SelectionEvent e) {
|
|
| 564 |
if (currentKnowledgeRepository == null) return; |
|
| 565 |
if (!(currentKnowledgeRepository instanceof LocalKnowledgeRepository)) return; |
|
| 547 | 566 |
|
| 567 |
LocalKnowledgeRepository kr = (LocalKnowledgeRepository)currentKnowledgeRepository; |
|
| 568 |
|
|
| 569 |
InputDialog dialog = new InputDialog(e.widget.getDisplay().getActiveShell(), "New property", "Enter the new property name", "", null); |
|
| 570 |
if (dialog.open() == InputDialog.OK) {
|
|
| 571 |
String name = dialog.getValue(); |
|
| 572 |
if (name.trim().length() == 0) return; |
|
| 573 |
String baseid = AsciiUtils.buildId(name); |
|
| 574 |
String id = AsciiUtils.buildId(name); |
|
| 575 |
int c = 1; |
|
| 576 |
while (kr.getType(id) != null) {
|
|
| 577 |
id = baseid+"_"+(c++); //$NON-NLS-1$ |
|
| 578 |
} |
|
| 579 |
AnnotationType type = kr.addType(name, id, "", AnnotationEffect.TOKEN); //$NON-NLS-1$ |
|
| 580 |
typesList.add(type); |
|
| 581 |
|
|
| 582 |
if (annotationTypesCombo != null) annotationTypesCombo.refresh(); |
|
| 583 |
if (typesList.size() == 1) {
|
|
| 584 |
if (annotationTypesCombo != null) annotationTypesCombo.getCombo().select(typesList.size()-1); |
|
| 585 |
|
|
| 586 |
if (concordance != null) {
|
|
| 587 |
annotations.setViewAnnotation(type); |
|
| 588 |
annotations.setAnnotationOverlap(true); |
|
| 589 |
annotationColumn.setText(type.getId()); |
|
| 590 |
editor.fillDisplayArea(false); |
|
| 591 |
} |
|
| 592 |
annotationArea.layout(true); |
|
| 593 |
|
|
| 594 |
} else {
|
|
| 595 |
if (typesList.size() > 1) {
|
|
| 596 |
if (annotationTypesCombo != null) {
|
|
| 597 |
annotationTypesCombo.setSelection(new StructuredSelection(typesList.get(typesList.size()-1))); |
|
| 598 |
} |
|
| 599 |
} |
|
| 600 |
} |
|
| 601 |
annotations.setViewAnnotation(type); |
|
| 602 |
annotationTypesCombo.setSelection(new StructuredSelection(typesList.get(typesList.size()-1))); |
|
| 603 |
annotationArea.layout(true); |
|
| 604 |
KRView.refresh(); |
|
| 605 |
updateAnnotationWidgetStates(); |
|
| 606 |
} else {
|
|
| 607 |
System.out.println("Creation aborted."); //$NON-NLS-1$
|
|
| 608 |
} |
|
| 609 |
} |
|
| 610 |
|
|
| 611 |
@Override |
|
| 612 |
public void widgetDefaultSelected(SelectionEvent e) { }
|
|
| 613 |
}); |
|
| 614 |
|
|
| 548 | 615 |
equalLabel = new Label(annotationArea, SWT.NONE); |
| 549 | 616 |
equalLabel.setText("="); //$NON-NLS-1$
|
| 550 | 617 |
equalLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false)); |
| ... | ... | |
| 565 | 632 |
@Override |
| 566 | 633 |
public void keyPressed(KeyEvent e) { }
|
| 567 | 634 |
}); |
| 635 |
|
|
| 636 |
addTypedValueLink = new Button(annotationArea, SWT.PUSH); |
|
| 637 |
addTypedValueLink.setText("..."); //$NON-NLS-1$
|
|
| 638 |
addTypedValueLink.setToolTipText(KRAnnotationUIMessages.selectAValueAmongTheList); |
|
| 639 |
addTypedValueLink.setEnabled(true); |
|
| 640 |
addTypedValueLink.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false)); |
|
| 641 |
addTypedValueLink.addSelectionListener(new SelectionListener() {
|
|
| 642 |
@Override |
|
| 643 |
public void widgetSelected(SelectionEvent e) {
|
|
| 644 |
if (currentKnowledgeRepository == null) return; |
|
| 645 |
if (!(currentKnowledgeRepository instanceof LocalKnowledgeRepository)) return; |
|
| 568 | 646 |
|
| 647 |
AnnotationType type = getSelectedAnnotationType(); |
|
| 648 |
if (type == null) return; |
|
| 649 |
|
|
| 650 |
LocalKnowledgeRepository kr = (LocalKnowledgeRepository)currentKnowledgeRepository; |
|
| 651 |
|
|
| 652 |
ListDialog dialog = new ListDialog(e.widget.getDisplay().getActiveShell()); |
|
| 653 |
String title = currentKnowledgeRepository.getString(editor.getLocale(), "ConcordancesEditor_100"); //$NON-NLS-1$ |
|
| 654 |
if (title == null) title = KRAnnotationUIMessages.availableValuesForP0; |
|
| 655 |
dialog.setTitle(ConcordanceUIMessages.bind(title, type.getName()));//+"valeurs de "+type.getName()); |
|
| 656 |
dialog.setContentProvider(new ArrayContentProvider()); |
|
| 657 |
dialog.setLabelProvider(new SimpleLabelProvider() {
|
|
| 658 |
public String getColumnText(Object element, int columnIndex) {
|
|
| 659 |
if (element instanceof TypedValue) |
|
| 660 |
return ((TypedValue)element).getId(); |
|
| 661 |
return element.toString(); |
|
| 662 |
} |
|
| 663 |
}); |
|
| 664 |
List<TypedValue> values; |
|
| 665 |
try {
|
|
| 666 |
values = kr.getValues(type); |
|
| 667 |
} catch (Exception e1) {
|
|
| 668 |
e1.printStackTrace(); |
|
| 669 |
return; |
|
| 670 |
} |
|
| 671 |
dialog.setInput(values); |
|
| 672 |
if (dialog.open() == InputDialog.OK) {
|
|
| 673 |
TypedValue value = (TypedValue) dialog.getResult()[0]; |
|
| 674 |
String name = value.getId(); |
|
| 675 |
if (name.trim().length() == 0) return; |
|
| 676 |
|
|
| 677 |
annotationValuesText.setText(name); |
|
| 678 |
} else {
|
|
| 679 |
|
|
| 680 |
} |
|
| 681 |
} |
|
| 682 |
|
|
| 683 |
@Override |
|
| 684 |
public void widgetDefaultSelected(SelectionEvent e) { }
|
|
| 685 |
}); |
|
| 686 |
|
|
| 687 |
new Label(annotationArea, SWT.NONE).setText(" ");
|
|
| 688 |
|
|
| 569 | 689 |
affectAnnotationButton = new Button(annotationArea, SWT.PUSH); |
| 570 | 690 |
affectAnnotationButton.setText(KRAnnotationUIMessages.oK); |
| 571 | 691 |
affectAnnotationButton.setToolTipText(KRAnnotationUIMessages.proceedToAnnotation); |
| ... | ... | |
| 710 | 830 |
while (kr.getType(id) != null) {
|
| 711 | 831 |
id = baseid+"_"+(c++); //$NON-NLS-1$ |
| 712 | 832 |
} |
| 713 |
AnnotationType type = kr.addType(name, id, ""); //$NON-NLS-1$ |
|
| 714 |
type.setEffect(AnnotationEffect.TOKEN); |
|
| 833 |
AnnotationType type = kr.addType(name, id, "", AnnotationEffect.TOKEN); //$NON-NLS-1$ |
|
| 715 | 834 |
typesList.add(type); |
| 716 | 835 |
annotationTypesCombo.refresh(); |
| 717 | 836 |
StructuredSelection selection = new StructuredSelection(type); |
| tmp/org.txm.annotation.kr.rcp/src/org/txm/annotation/kr/rcp/concordance/ConcordanceAnnotations.java (revision 2108) | ||
|---|---|---|
| 204 | 204 |
} |
| 205 | 205 |
return annotationsPerMatch; |
| 206 | 206 |
} |
| 207 |
|
|
| 208 | 207 |
|
| 209 | 208 |
public void setViewAnnotation(AnnotationType type) {
|
| 210 | 209 |
viewAnnotation = type; |
| tmp/org.txm.annotation.kr.rcp/src/org/txm/annotation/kr/rcp/preferences/KRAnnotationPreferencePage.java (revision 2108) | ||
|---|---|---|
| 27 | 27 |
// |
| 28 | 28 |
package org.txm.annotation.kr.rcp.preferences; |
| 29 | 29 |
|
| 30 |
import org.eclipse.jface.preference.BooleanFieldEditor; |
|
| 31 |
import org.eclipse.jface.preference.IntegerFieldEditor; |
|
| 30 | 32 |
import org.eclipse.ui.IWorkbench; |
| 31 |
import org.txm.annotation.kr.core.preferences.AnnotationPreferences; |
|
| 33 |
import org.txm.annotation.kr.core.preferences.KRAnnotationPreferences; |
|
| 34 |
import org.txm.concordance.core.preferences.ConcordancePreferences; |
|
| 35 |
import org.txm.concordance.rcp.messages.ConcordanceUIMessages; |
|
| 32 | 36 |
import org.txm.rcp.IImageKeys; |
| 33 | 37 |
import org.txm.rcp.preferences.TXMPreferencePage; |
| 34 | 38 |
import org.txm.rcp.preferences.TXMPreferenceStore; |
| ... | ... | |
| 44 | 48 |
*/ |
| 45 | 49 |
|
| 46 | 50 |
public class KRAnnotationPreferencePage extends TXMPreferencePage {
|
| 47 |
|
|
| 51 |
|
|
| 48 | 52 |
/** |
| 49 | 53 |
* Instantiates the preference page. |
| 50 | 54 |
*/ |
| ... | ... | |
| 59 | 63 |
*/ |
| 60 | 64 |
@Override |
| 61 | 65 |
public void createFieldEditors() {
|
| 62 |
|
|
| 66 |
this.addField(new BooleanFieldEditor(KRAnnotationPreferences.PRESERVE_ANNOTATIONS, "Preserve annotations between TXM sessions", this.getFieldEditorParent())); |
|
| 67 |
this.addField(new BooleanFieldEditor(KRAnnotationPreferences.UPDATE_EDITION, "When saving annotations rebuild editions" , this.getFieldEditorParent())); |
|
| 63 | 68 |
} |
| 64 | 69 |
|
| 65 |
|
|
| 66 | 70 |
/* |
| 67 | 71 |
* (non-Javadoc) |
| 68 | 72 |
* |
| ... | ... | |
| 71 | 75 |
*/ |
| 72 | 76 |
@Override |
| 73 | 77 |
public void init(IWorkbench workbench) {
|
| 74 |
this.setPreferenceStore(new TXMPreferenceStore(AnnotationPreferences.getInstance().getPreferencesNodeQualifier())); |
|
| 78 |
this.setPreferenceStore(new TXMPreferenceStore(KRAnnotationPreferences.getInstance().getPreferencesNodeQualifier()));
|
|
| 75 | 79 |
this.setImageDescriptor(IImageKeys.getImageDescriptor(IImageKeys.PENCIL)); |
| 76 | 80 |
} |
| 77 | 81 |
} |
| tmp/org.txm.annotation.kr.core/src/org/txm/annotation/kr/core/repository/KnowledgeRepository.java (revision 2108) | ||
|---|---|---|
| 90 | 90 |
properties.put("javax.persistence.jdbc.url", urlProperty);
|
| 91 | 91 |
// properties.put("javax.persistence.jdbc.username", "SA");
|
| 92 | 92 |
// properties.put(PersistenceUnitProperties.DDL_GENERATION_MODE, "database"); |
| 93 |
// properties.put(PersistenceUnitProperties.DDL_GENERATION, "create-or-extend-tables"); // create&update table if needed
|
|
| 94 |
properties.put(PersistenceUnitProperties.DDL_GENERATION, "drop-and-create-tables"); // drop all and recreate |
|
| 93 |
properties.put(PersistenceUnitProperties.DDL_GENERATION, "create-or-extend-tables"); // create&update table if needed |
|
| 94 |
// properties.put(PersistenceUnitProperties.DDL_GENERATION, "drop-and-create-tables"); // drop all and recreate
|
|
| 95 | 95 |
// if (Log.getLevel().intValue() < Level.WARNING.intValue()) {
|
| 96 | 96 |
// properties.put(PersistenceUnitProperties.LOGGING_LEVEL, "WARNING"); |
| 97 | 97 |
// properties.put(PersistenceUnitProperties.LOGGING_PARAMETERS, "true"); |
| ... | ... | |
| 158 | 158 |
} |
| 159 | 159 |
|
| 160 | 160 |
/** |
| 161 |
* returns a resource url for a defined TypedValue (for instance to display in a html viewer)
|
|
| 161 |
* returns a resource URL for a defined TypedValue (for instance to display in a html viewer)
|
|
| 162 | 162 |
* @param kr |
| 163 | 163 |
* @param typedValue |
| 164 | 164 |
* @return |
| ... | ... | |
| 168 | 168 |
} |
| 169 | 169 |
|
| 170 | 170 |
/** |
| 171 |
* returns a resource url for a defined TypedValue (for instance to display in a html viewer)
|
|
| 171 |
* returns a resource URL for a defined TypedValue (for instance to display in a html viewer)
|
|
| 172 | 172 |
* @param kr |
| 173 | 173 |
* @param typedValue |
| 174 | 174 |
* @return |
| ... | ... | |
| 184 | 184 |
} |
| 185 | 185 |
|
| 186 | 186 |
/** |
| 187 |
* returns a url for a defined KnowledgeRepository (for instance to display in a html viewer)
|
|
| 187 |
* returns a URL for a defined KnowledgeRepository (for instance to display in a html viewer)
|
|
| 188 | 188 |
* @param kr |
| 189 | 189 |
* @param typedValue |
| 190 | 190 |
* @return |
| tmp/org.txm.annotation.kr.core/src/org/txm/annotation/kr/core/preferences/AnnotationPreferences.java (revision 2108) | ||
|---|---|---|
| 1 |
package org.txm.annotation.kr.core.preferences; |
|
| 2 |
|
|
| 3 |
|
|
| 4 |
import org.osgi.service.prefs.Preferences; |
|
| 5 |
import org.txm.core.preferences.TXMPreferences; |
|
| 6 |
|
|
| 7 |
/** |
|
| 8 |
* Preferences initializer and manager. |
|
| 9 |
* @author mdecorde |
|
| 10 |
* @author sjacquot |
|
| 11 |
* |
|
| 12 |
*/ |
|
| 13 |
public class AnnotationPreferences extends TXMPreferences {
|
|
| 14 |
|
|
| 15 |
|
|
| 16 |
public static final String ANNOTATION_MODE = "annotation_mode"; |
|
| 17 |
|
|
| 18 |
/** |
|
| 19 |
* Gets the instance. |
|
| 20 |
* @return the instance |
|
| 21 |
*/ |
|
| 22 |
public static TXMPreferences getInstance() {
|
|
| 23 |
if (!TXMPreferences.instances.containsKey(AnnotationPreferences.class)) {
|
|
| 24 |
new AnnotationPreferences(); |
|
| 25 |
} |
|
| 26 |
return TXMPreferences.instances.get(AnnotationPreferences.class); |
|
| 27 |
} |
|
| 28 |
|
|
| 29 |
|
|
| 30 |
@Override |
|
| 31 |
public void initializeDefaultPreferences() {
|
|
| 32 |
super.initializeDefaultPreferences(); |
|
| 33 |
Preferences preferences = this.getDefaultPreferencesNode(); |
|
| 34 |
preferences.put(ANNOTATION_MODE, "simple"); |
|
| 35 |
} |
|
| 36 |
} |
|
| tmp/org.txm.annotation.kr.core/src/org/txm/annotation/kr/core/preferences/KRAnnotationPreferences.java (revision 2108) | ||
|---|---|---|
| 1 |
package org.txm.annotation.kr.core.preferences; |
|
| 2 |
|
|
| 3 |
import org.osgi.service.prefs.Preferences; |
|
| 4 |
import org.txm.core.preferences.TXMPreferences; |
|
| 5 |
|
|
| 6 |
/** |
|
| 7 |
* Preferences initializer and manager. |
|
| 8 |
* @author mdecorde |
|
| 9 |
* @author sjacquot |
|
| 10 |
* |
|
| 11 |
*/ |
|
| 12 |
public class KRAnnotationPreferences extends TXMPreferences {
|
|
| 13 |
|
|
| 14 |
public static final String UPDATE_EDITION = "udpate_edition"; |
|
| 15 |
public static final String PRESERVE_ANNOTATIONS = "reset_temporary_annotations_when leaving_txm"; |
|
| 16 |
|
|
| 17 |
/** |
|
| 18 |
* Gets the instance. |
|
| 19 |
* @return the instance |
|
| 20 |
*/ |
|
| 21 |
public static TXMPreferences getInstance() {
|
|
| 22 |
if (!TXMPreferences.instances.containsKey(KRAnnotationPreferences.class)) {
|
|
| 23 |
new KRAnnotationPreferences(); |
|
| 24 |
} |
|
| 25 |
return TXMPreferences.instances.get(KRAnnotationPreferences.class); |
|
| 26 |
} |
|
| 27 |
|
|
| 28 |
@Override |
|
| 29 |
public void initializeDefaultPreferences() {
|
|
| 30 |
super.initializeDefaultPreferences(); |
|
| 31 |
Preferences preferences = this.getDefaultPreferencesNode(); |
|
| 32 |
preferences.putBoolean(UPDATE_EDITION, true); |
|
| 33 |
preferences.putBoolean(PRESERVE_ANNOTATIONS, true); |
|
| 34 |
} |
|
| 35 |
} |
|
| 0 | 36 | |
| tmp/org.txm.annotation.kr.core/src/org/txm/annotation/kr/core/storage/temporary/TemporaryAnnotationManager.java (revision 2108) | ||
|---|---|---|
| 12 | 12 |
|
| 13 | 13 |
import org.eclipse.persistence.config.PersistenceUnitProperties; |
| 14 | 14 |
import org.eclipse.persistence.jpa.PersistenceProvider; |
| 15 |
import org.txm.annotation.core.preferences.AnnotationPreferences; |
|
| 15 | 16 |
import org.txm.annotation.kr.core.Annotation; |
| 16 | 17 |
import org.txm.annotation.kr.core.AnnotationPK; |
| 17 | 18 |
import org.txm.annotation.kr.core.DatabasePersistenceManager; |
| 19 |
import org.txm.annotation.kr.core.preferences.KRAnnotationPreferences; |
|
| 18 | 20 |
import org.txm.annotation.kr.core.repository.AnnotationEffect; |
| 19 | 21 |
import org.txm.annotation.kr.core.repository.AnnotationType; |
| 20 | 22 |
import org.txm.annotation.kr.core.repository.TypedValue; |
| ... | ... | |
| 49 | 51 |
properties.put("javax.persistence.jdbc.url", urlProperty);
|
| 50 | 52 |
properties.put("javax.persistence.jdbc.username", "SA");
|
| 51 | 53 |
properties.put(PersistenceUnitProperties.DDL_GENERATION_MODE, "database"); |
| 52 |
properties.put(PersistenceUnitProperties.DDL_GENERATION, "drop-and-create-tables"); // create&update table if needed, drop-and-create-tables to reset all |
|
| 54 |
if (KRAnnotationPreferences.getInstance().getBoolean(KRAnnotationPreferences.PRESERVE_ANNOTATIONS)) {
|
|
| 55 |
properties.put(PersistenceUnitProperties.DDL_GENERATION, "drop-and-create-tables"); // drop-and-create-tables to reset all |
|
| 56 |
} else {
|
|
| 57 |
properties.put(PersistenceUnitProperties.DDL_GENERATION, "create-or-extend-tables"); // create&update table if needed, drop-and-create-tables to reset all |
|
| 58 |
} |
|
| 53 | 59 |
|
| 54 | 60 |
if (Log.getLevel().intValue() < Level.INFO.intValue()) {
|
| 55 | 61 |
properties.put(PersistenceUnitProperties.LOGGING_LEVEL, "INFO"); |
| tmp/org.txm.annotation.kr.core/plugin.xml (revision 2108) | ||
|---|---|---|
| 4 | 4 |
<extension |
| 5 | 5 |
point="org.eclipse.core.runtime.preferences"> |
| 6 | 6 |
<initializer |
| 7 |
class="org.txm.annotation.kr.core.preferences.AnnotationPreferences"> |
|
| 7 |
class="org.txm.annotation.kr.core.preferences.KRAnnotationPreferences">
|
|
| 8 | 8 |
</initializer> |
| 9 | 9 |
</extension> |
| 10 | 10 |
<extension |
| tmp/org.txm.rcp.feature/build.properties (revision 2108) | ||
|---|---|---|
| 9 | 9 |
root.linux.gtk.x86_64.permissions.755=jre/bin/java,plugins/org.txm.libs.cqp.linux/res/linux32/,plugins/org.txm.libs.cqp.linux/res/linux64/,plugins/org.txm.statsengine.r.core.linux/res/linux64/bin/R,plugins/org.txm.statsengine.r.core.linux/res/linux64/bin/exec/R |
| 10 | 10 |
root.linux.gtk.x86_64=linux/ |
| 11 | 11 |
root.macosx.cocoa.x86_64.permissions.755=jre/bin/java,plugins/org.txm.libs.cqp.macosx/res/macosx/,plugins/org.txm.statsengine.r.core.macosx/res/macosx/bin/R,plugins/org.txm.statsengine.r.core.macosx/res/macosx/bin/exec/R |
| 12 |
qualifier=svn |
|
| tmp/org.txm.analec.rcp/src/org/txm/macro/urs/democrat/Verifications_alMacro.groovy (revision 2108) | ||
|---|---|---|
| 1 |
// Auteur Matthieu Quignard |
|
| 2 |
// Date : 14 janvier 2019 |
|
| 3 |
|
|
| 4 |
/********** |
|
| 5 |
Vérifications automatiques |
|
| 6 |
1. Repère les mentions sans catégorie : CHECK > CAT |
|
| 7 |
2. Repère les mentions sans référent : CHECK > REF |
|
| 8 |
3. Supprime les ponctuations en début et en fin de mention : CHECK > BORNES |
|
| 9 |
4. Supprime les prépositions autres que 'de' en début de mention : CHECK > BORNES |
|
| 10 |
5. Supprime automatiquement toutes les mentions vides = sans aucun mot = de longueur 0 |
|
| 11 |
6. Détecter les mentions qui ont exactement les mêmes bornes : CHECK > DOUBLON |
|
| 12 |
7 (option). Détecter les pronoms hors mention : CHECK > NEW |
|
| 13 |
***********/ |
|
| 14 |
|
|
| 15 |
package org.txm.macro.urs.democrat |
|
| 16 |
|
|
| 17 |
import org.apache.commons.lang.* |
|
| 18 |
import org.kohsuke.args4j.* |
|
| 19 |
import groovy.transform.* |
|
| 20 |
import org.txm.* |
|
| 21 |
import org.txm.rcpapplication.swt.widget.parameters.* |
|
| 22 |
import org.txm.analec.* |
|
| 23 |
import org.txm.searchengine.cqp.* |
|
| 24 |
import org.txm.searchengine.cqp.corpus.* |
|
| 25 |
import visuAnalec.Message.* |
|
| 26 |
import visuAnalec.donnees.* |
|
| 27 |
import visuAnalec.elements.* |
|
| 28 |
import visuAnalec.vue.* |
|
| 29 |
|
|
| 30 |
// TODO : ajouter les étiquettes équivalentes issues du tagset TreeTagger |
|
| 31 |
// Ponctuations et Prépositions |
|
| 32 |
def interditsAuDebut = ["PONfbl", "PONfrt", "PONpxx", "PRE"] |
|
| 33 |
// Ponctuations |
|
| 34 |
def interditsALaFin = ["PONfbl", "PONfrt", "PONpxx"] |
|
| 35 |
// Pronoms en tous genres |
|
| 36 |
def listePronoms = ["PROadv", "PROcar", "PROdem", "PROind", "PROint", "PROper", "PROpos", "PROrel"] |
|
| 37 |
// AL: supprimé PROimp (non référentiel) de la liste des pronoms |
|
| 38 |
|
|
| 39 |
// CORPS DU SCRIPT |
|
| 40 |
|
|
| 41 |
if (!(corpusViewSelection instanceof MainCorpus)) {
|
|
| 42 |
println "Corpora selection is not a Corpus" |
|
| 43 |
return |
|
| 44 |
} |
|
| 45 |
|
|
| 46 |
// BEGINNING OF PARAMETERS |
|
| 47 |
@Field @Option(name="unit_type", usage="Unité", widget="String", required=true, def="MENTION") |
|
| 48 |
def unit_type |
|
| 49 |
@Field @Option(name="pos_property_name", usage="Etiquette de morphosyntaxe", widget="String", required=true, def="frpos") |
|
| 50 |
def pos_property_name |
|
| 51 |
@Field @Option(name="cat_name", usage="Propriété CATEGORIE", widget="String", required=true, def="CATEGORIE") |
|
| 52 |
def cat_name |
|
| 53 |
@Field @Option(name="ref_name", usage="Propriété REF", widget="String", required=true, def="REF") |
|
| 54 |
def ref_name |
|
| 55 |
@Field @Option(name="checkPronouns", usage="Vérifier les pronoms oubliés", widget="Boolean", required=true, def="true") |
|
| 56 |
def checkPronouns |
|
| 57 |
|
|
| 58 |
if (!ParametersDialog.open(this)) return |
|
| 59 |
|
|
| 60 |
corpus = corpusViewSelection |
|
| 61 |
CQI = Toolbox.getCqiClient() |
|
| 62 |
word = corpus.getWordProperty() |
|
| 63 |
posProperty = corpus.getProperty(pos_property_name) |
|
| 64 |
if (posProperty == null) {
|
|
| 65 |
println "Error: CQP corpus does not contain the word property with name=$pos_property_name" |
|
| 66 |
return |
|
| 67 |
} |
|
| 68 |
|
|
| 69 |
analecCorpus = AnalecCorpora.getCorpus(corpus.getName()) |
|
| 70 |
vue = AnalecCorpora.getVue(corpus.getName()) |
|
| 71 |
structure = analecCorpus.getStructure() |
|
| 72 |
|
|
| 73 |
if (!structure.getUnites().contains(unit_type)) { // check if the structure contains the unit_type units
|
|
| 74 |
println "Error: corpus structure does not contains unit with name=$unit_type" |
|
| 75 |
return |
|
| 76 |
} |
|
| 77 |
|
|
| 78 |
if (!structure.getUniteProperties(unit_type).contains(cat_name)) {
|
|
| 79 |
println "Erreur : les unités $unit_type n'ont pas de propriété $cat_name" |
|
| 80 |
return |
|
| 81 |
} |
|
| 82 |
|
|
| 83 |
if (!structure.getUniteProperties(unit_type).contains(ref_name)) {
|
|
| 84 |
println "Erreur : les unités $unit_type n'ont pas de propriété $ref_name" |
|
| 85 |
return |
|
| 86 |
} |
|
| 87 |
|
|
| 88 |
println "Détection des pronoms oubliés : $checkPronouns" |
|
| 89 |
|
|
| 90 |
// Reinitialiser la propriété CHECK |
|
| 91 |
if (!structure.getUniteProperties(unit_type).contains("CHECK")) {
|
|
| 92 |
analecCorpus.ajouterProp(Unite.class, unit_type, "CHECK") |
|
| 93 |
} else {
|
|
| 94 |
println "Nettoyage des anciennes annotations CHECK" |
|
| 95 |
def tmpvalues = new HashSet() |
|
| 96 |
tmpvalues.addAll(structure.getValeursProp(Unite.class, unit_type, "CHECK")); |
|
| 97 |
for (String val : tmpvalues) {
|
|
| 98 |
structure.supprimerVal(Unite.class, unit_type, "CHECK", val); |
|
| 99 |
//println "suppression de l'étiquette $val" |
|
| 100 |
} |
|
| 101 |
} |
|
| 102 |
|
|
| 103 |
structure.ajouterVal(Unite.class, unit_type, "CHECK", "DONE") |
|
| 104 |
|
|
| 105 |
|
|
| 106 |
|
|
| 107 |
def nModified = 0 |
|
| 108 |
def nIgnored = 0 |
|
| 109 |
def nDeleted = 0 |
|
| 110 |
def nAdded = 0 |
|
| 111 |
|
|
| 112 |
def garbageBin = [] |
|
| 113 |
|
|
| 114 |
def nToks = corpus.getSize() |
|
| 115 |
def tokenIndex = new int[nToks] |
|
| 116 |
|
|
| 117 |
def i = 0 |
|
| 118 |
for (i=0 ; i< nToks ; i++) tokenIndex[i] = 1 |
|
| 119 |
|
|
| 120 |
errors = new HashMap() |
|
| 121 |
def units = analecCorpus.getUnites(unit_type) |
|
| 122 |
units.sort() { a, b -> a.getDeb() <=> b.getDeb() ?: a.getFin() <=> b.getFin() }
|
|
| 123 |
|
|
| 124 |
// pour les doublons |
|
| 125 |
def lastUnit = null |
|
| 126 |
|
|
| 127 |
for (Unite unit : units) { // process all units
|
|
| 128 |
def erreur = "" |
|
| 129 |
|
|
| 130 |
// 1. Catégories vides |
|
| 131 |
def cat = unit.getProp( cat_name ); |
|
| 132 |
if (cat == "") erreur += "CAT " |
|
| 133 |
|
|
| 134 |
// 2. Référents vides (plus grave) ; pas besoin de catégories |
|
| 135 |
def ref = unit.getProp( ref_name ); |
|
| 136 |
if (ref == "") erreur += "REF " |
|
| 137 |
|
|
| 138 |
// 3. Suppression des erreurs initiales ; besoin de catégories |
|
| 139 |
int[] positions = null |
|
| 140 |
if (unit.getDeb() == unit.getFin()) positions = [unit.getDeb()] |
|
| 141 |
else positions = (unit.getDeb()..unit.getFin()) |
|
| 142 |
def Mention = CQI.cpos2Str(posProperty.getQualifiedName(), positions) |
|
| 143 |
|
|
| 144 |
def isOK = false |
|
| 145 |
while (isOK == false) {
|
|
| 146 |
if (interditsAuDebut.contains(Mention[0])) {
|
|
| 147 |
if (positions.size() == 1) {
|
|
| 148 |
erreur += "SUPPR" |
|
| 149 |
isOK = true |
|
| 150 |
} else {
|
|
| 151 |
def debut = unit.getDeb() |
|
| 152 |
unit.setDeb( debut + 1 ) |
|
| 153 |
|
|
| 154 |
if (unit.getDeb() == unit.getFin()) positions = [unit.getDeb()] |
|
| 155 |
else positions = (unit.getDeb()..unit.getFin()) |
|
| 156 |
Mention = CQI.cpos2Str(posProperty.getQualifiedName(), positions) |
|
| 157 |
if (!erreur.contains("BORNESG")) erreur += "BORNESG "
|
|
| 158 |
} |
|
| 159 |
} else {
|
|
| 160 |
isOK = true |
|
| 161 |
} |
|
| 162 |
} |
|
| 163 |
|
|
| 164 |
|
|
| 165 |
// 4. Suppression des erreurs de borne de fin ; besoin de catégories |
|
| 166 |
if (unit.getDeb() == unit.getFin()) positions = [unit.getDeb()] |
|
| 167 |
else positions = (unit.getDeb()..unit.getFin()) |
|
| 168 |
Mention = CQI.cpos2Str(posProperty.getQualifiedName(), positions) |
|
| 169 |
|
|
| 170 |
isOK = false |
|
| 171 |
while ((isOK == false) && (erreur != "remove")) {
|
|
| 172 |
def n = Mention.size() |
|
| 173 |
if (interditsALaFin.contains(Mention[ n-1 ])) {
|
|
| 174 |
if (positions.size() == 1) {
|
|
| 175 |
if (!erreur.contains("SUPPR")) erreur += "SUPPR"
|
|
| 176 |
isOK = true |
|
| 177 |
} else {
|
|
| 178 |
def fin = unit.getFin() |
|
| 179 |
unit.setFin( fin - 1 ) |
|
| 180 |
|
|
| 181 |
if (unit.getDeb() == unit.getFin()) positions = [unit.getDeb()] |
|
| 182 |
else positions = (unit.getDeb()..unit.getFin()) |
|
| 183 |
Mention = CQI.cpos2Str(posProperty.getQualifiedName(), positions) |
|
| 184 |
if (!erreur.contains("BORNESD")) erreur += "BORNESD "
|
|
| 185 |
} |
|
| 186 |
} else isOK = true |
|
| 187 |
} |
|
| 188 |
|
|
| 189 |
// 5. Suppression des unités problématiques (bornes incohérentes ou mot vide) ; pas besoin de catégories |
|
| 190 |
def forme = CQI.cpos2Str(word.getQualifiedName(), positions)[0].trim().toLowerCase() |
|
| 191 |
|
|
| 192 |
if (erreur == "remove") {}
|
|
| 193 |
else if (unit.getFin() < unit.getDeb()) {
|
|
| 194 |
println "ERREUR GRAVE : segmentation incohérente" |
|
| 195 |
erreur = "remove" |
|
| 196 |
} else if ( forme.length() == 0 ) {
|
|
| 197 |
println "ERREUR GRAVE : unité sans mot" |
|
| 198 |
erreur = "remove" |
|
| 199 |
} |
|
| 200 |
|
|
| 201 |
// 6. Détection des doublons ; pas besoin de catégories |
|
| 202 |
if (lastUnit != null) {
|
|
| 203 |
if ((unit.getDeb() == lastUnit.getDeb()) && (unit.getFin() == lastUnit.getFin()) ) {
|
|
| 204 |
erreur += " DOUBLON " |
|
| 205 |
} |
|
| 206 |
} |
|
| 207 |
lastUnit = unit |
|
| 208 |
|
|
| 209 |
|
|
| 210 |
erreur = erreur.trim() |
|
| 211 |
if (erreur == "remove") {
|
|
| 212 |
garbageBin.add( unit ) |
|
| 213 |
nDeleted++ |
|
| 214 |
} else if (erreur != "") {
|
|
| 215 |
vue.setValeurChamp(unit, "CHECK", erreur) |
|
| 216 |
nModified++ |
|
| 217 |
} else {
|
|
| 218 |
nIgnored++ |
|
| 219 |
} |
|
| 220 |
|
|
| 221 |
// mise à jour des tokens couverts |
|
| 222 |
for (int p=unit.getDeb() ; p <= unit.getFin() ; p++) {
|
|
| 223 |
tokenIndex[p] = 0 |
|
| 224 |
} |
|
| 225 |
} |
|
| 226 |
|
|
| 227 |
// Suppression effective des unités incohérentes |
|
| 228 |
garbageBin.each {
|
|
| 229 |
analecCorpus.supUnite( it ) |
|
| 230 |
} |
|
| 231 |
|
|
| 232 |
// 7. Ajouter les pronoms non couverts par une annotation ; besoin de catégories |
|
| 233 |
// Parcourir les tokens non couverts ; obtenir leur POS et créer une unité si c'est un pronom |
|
| 234 |
|
|
| 235 |
if (checkPronouns) {
|
|
| 236 |
println "Détection des pronoms oubliés" |
|
| 237 |
for (i=0 ; i < nToks ; i++) {
|
|
| 238 |
if (tokenIndex[i] > 0) {
|
|
| 239 |
Mention = CQI.cpos2Str(posProperty.getQualifiedName(), i) |
|
| 240 |
mentionForme = CQI.cpos2Str(word.getQualifiedName(), i) |
|
| 241 |
if (listePronoms.contains(Mention[0]) && mentionForme[0] != "s'" && mentionForme[0] != "se" && mentionForme[0] != "riens") {
|
|
| 242 |
def props = [:] |
|
| 243 |
props["CHECK"] = "NEW" |
|
| 244 |
Unite u = analecCorpus.addUniteSaisie(unit_type, i, i, props) |
|
| 245 |
vue.setValeurChamp(u, "CHECK", "NEW") |
|
| 246 |
nAdded++ |
|
| 247 |
} |
|
| 248 |
} |
|
| 249 |
} |
|
| 250 |
} |
|
| 251 |
|
|
| 252 |
if (nAdded + nModified + nDeleted > 0) corpus.setIsModified(true); |
|
| 253 |
|
|
| 254 |
println "Result:" |
|
| 255 |
println "- $nModified units of type $unit_type have been modified." |
|
| 256 |
println "- $nDeleted units of type $unit_type have been deleted." |
|
| 257 |
println "- $nIgnored units of type $unit_type have not been modified." |
|
| 258 |
println "- $nAdded forgotten pronominal units of type $unit_type have been added.\n" |
|
| 259 |
|
|
| 260 |
AnalecCorpora.getVue(analecCorpus).retablirVueParDefaut() |
|
| tmp/org.txm.analec.rcp/src/org/txm/macro/urs/democrat/VerificationsMacro.groovy (revision 2108) | ||
|---|---|---|
| 1 |
// Auteur Matthieu Quignard |
|
| 1 |
// Auteur Matthieu Quignard, Alexey Lavrentev
|
|
| 2 | 2 |
// Date : 14 janvier 2019 |
| 3 | 3 |
|
| 4 | 4 |
/********** |
| 5 |
Vérifications automatiques |
|
| 5 |
Vérifications automatiques :
|
|
| 6 | 6 |
1. Repère les mentions sans catégorie : CHECK > CAT |
| 7 | 7 |
2. Repère les mentions sans référent : CHECK > REF |
| 8 | 8 |
3. Supprime les ponctuations en début et en fin de mention : CHECK > BORNES |
| tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/MainCorpus.java (revision 2108) | ||
|---|---|---|
| 372 | 372 |
public List<Match> getMatches() {
|
| 373 | 373 |
List<Match> rez = new ArrayList<Match>(); |
| 374 | 374 |
try {
|
| 375 |
rez.add(new Match(0, this.getSize())); |
|
| 375 |
rez.add(new Match(0, this.getSize()-1));
|
|
| 376 | 376 |
return rez; |
| 377 | 377 |
} catch (CqiClientException e) {
|
| 378 | 378 |
org.txm.utils.logger.Log.printStackTrace(e); |
Formats disponibles : Unified diff