Révision 3547

TXM/trunk/org.txm.concordance.rcp/src/org/txm/concordance/rcp/editors/ConcordanceEditor.java (revision 3547)
949 949
		else {
950 950
			lines = new ArrayList<>();
951 951
		}
952
		
952
				
953 953
		viewerRight.setInput(lines);
954 954
		viewerLeft.setInput(lines);
955 955
		
TXM/trunk/org.txm.groovy.core/src/groovy/org/txm/macro/annotation/BuildWordPropTableMacro.groovy (revision 3547)
82 82
println "- corpus: $corpus"
83 83
println "- query: $query"
84 84
println "- annotation properties: $properties"
85
println "- references: $properties"
85
println "- references: $references"
86 86
println "- CSV file: $csvFile"
87 87

  
88 88
csvFile = csvFile.getAbsoluteFile()
TXM/trunk/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/transcriber/compiler.groovy (revision 3547)
585 585
							break;
586 586
						case "w":
587 587
						// concat spk id and ref
588
							String isEnq = (interviewers != null && interviewers.contains(u_name))?"*":"";
588
							String isEnq = (interviewers != null && u_name =~ interviewers?"*":"";
589 589
							String ref = (u_name+", "+formatedTime+""+isEnq)
590 590
							if (ADD_TEXTID_TO_REF) ref = textid+", "+ref
591 591
							vForm +="\t"+u_name+"\t"+ref
......
615 615
							vForm = vForm.replaceAll("\n", "").replaceAll("&", "&amp;").replaceAll("<", "&lt;");
616 616
						
617 617
							if (interviewers != null && !indexInterviewer) { // we must remove some words
618
								if (!interviewers.contains(u_name)) { // keep what is now an interviewer
618
								if (!(u_name =~ interviewers)) { // keep what is now an interviewer
619 619
									output.write(vForm+"\t"+wordid+vAna+"\n");
620 620
								}
621 621
							} else {
......
733 733
		//assert(parser != null);
734 734
		for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()) {
735 735
			if (event == XMLStreamConstants.START_ELEMENT) {
736
				localname = parser.getLocalName();
736
				localname = parser.getLocalName()
737 737
				
738 738
				if (projectionsFromValues.containsKey(localname)) { // get projections values
739 739
					for (String attr : projectionsFromValues[localname].keySet()) {
740
						projectionsFromValues[localname][attr] = parser.getAttributeValue(null, attr);
740
						projectionsFromValues[localname][attr] = parser.getAttributeValue(null, attr)
741 741
					}
742 742
				}
743 743
				
......
746 746
						output.write("<text project=\""+projectname+"\" base=\""+corpusname+"\"")
747 747
						for (int i = 0 ; i < parser.getAttributeCount() ; i ++) {
748 748
							
749
							String value = parser.getAttributeValue(i).replace("\"", "&quot;");
749
							String value = parser.getAttributeValue(i).replace("\"", "&quot;")
750 750
							if (value.length() > MAXATTRIBUTEVALUELENGTH) {
751 751
								//								value = value.substring(0, MAXATTRIBUTEVALUELENGTH-1)
752 752
								println "WARNING: attribute value is too long ( > $MAXATTRIBUTEVALUELENGTH). The value will be truncated to: $value"
......
757 757
										parser.getAttributeLocalName(i) != "audio_filename" &&
758 758
										parser.getAttributeLocalName(i) != "version" &&
759 759
										parser.getAttributeLocalName(i) != "version_date") {
760
									output.write(" "+parser.getAttributeLocalName(i).replace("_","").toLowerCase()+"=\""+value+"\"");
760
									output.write(" "+parser.getAttributeLocalName(i).replace("_","").toLowerCase()+"=\""+value+"\"")
761 761
								}
762 762
							} else {
763
								output.write(" "+parser.getAttributeLocalName(i).replace("_","").toLowerCase()+"=\""+value+"\"");
763
								output.write(" "+parser.getAttributeLocalName(i).replace("_","").toLowerCase()+"=\""+value+"\"")
764 764
							}
765 765
						}
766 766
					
767 767
						output.write ">\n"
768 768
					
769 769
						ArrayList list = new ArrayList<Pair<String, String>>()
770
						trans.put("trans", list);
770
						trans.put("trans", list)
771 771
					
772 772
						for (int i = 0 ; i < parser.getAttributeCount() ; i ++) {
773
							list.add(new Pair(parser.getAttributeLocalName(i).replace("_","").toLowerCase(), parser.getAttributeValue(i)));
773
							list.add(new Pair(parser.getAttributeLocalName(i).replace("_","").toLowerCase(), parser.getAttributeValue(i)))
774 774
							if (parser.getAttributeLocalName(i).equals("interviewer-id-regex"))
775
								interviewers = /${parser.getAttributeValue(i)}/;
775
								interviewers = /${parser.getAttributeValue(i)}/
776 776
						}
777 777
						return
778 778
					case "Topic":
779
						String id = parser.getAttributeValue(null, "id");
779
						String id = parser.getAttributeValue(null, "id")
780 780
						if (id != null) {
781 781
							ArrayList list = new ArrayList<Pair<String, String>>()
782
							topics.put(id, list);
782
							topics.put(id, list)
783 783
						} else {
784 784
							println "found tag $localname with no id"
785 785
						}
786 786
						break;
787 787
					case "Speaker":
788 788
					//case "Trans":
789
						String id = parser.getAttributeValue(null, "id");
790
						String name = parser.getAttributeValue(null, "name");
789
						String id = parser.getAttributeValue(null, "id")
790
						String name = parser.getAttributeValue(null, "name")
791 791
						if (id != null && name != null) {
792 792
							speakersname.put(id, name);
793 793
						} else {
TXM/trunk/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/transcriber/pager.groovy (revision 3547)
922 922
		
923 923
		writer.writeStartElement("span");
924 924
		writer.writeAttribute("class", "spk");
925
		bold = interviewers != null && interviewers.contains(spk)
925
		bold = interviewers != null && spk =~ interviewers
926 926
		spk = spk.replaceAll('^([^0-9]*)([0-9]+)$', '$1 $2');
927 927
		if (overlapping) {
928 928
			writer.writeCharacters("// ")
TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/swt/dialog/QueryAssistDialog.java (revision 3547)
42 42
import org.eclipse.swt.events.ControlEvent;
43 43
import org.eclipse.swt.events.SelectionEvent;
44 44
import org.eclipse.swt.events.SelectionListener;
45
import org.eclipse.swt.graphics.Font;
46
import org.eclipse.swt.graphics.FontData;
45 47
import org.eclipse.swt.graphics.Rectangle;
46 48
import org.eclipse.swt.layout.GridData;
47 49
import org.eclipse.swt.layout.GridLayout;
......
190 192
			
191 193
			addWordField();
192 194
			
195
			Button addwordButton = new Button(mainPanel, SWT.PUSH);
196
			FontData[] fd = mainPanel.getFont().getFontData();
197
			fd[0].setStyle(SWT.BOLD);
198
			Font font = new Font(mainPanel.getFont().getDevice(), fd);
199
			addwordButton.setFont(font);
200
			addwordButton.setLayoutData(new GridData(GridData.CENTER, GridData.CENTER, false, false));
201
			addwordButton.setText(TXMUIMessages.addAWord+" ⯯");
202
			addwordButton.addSelectionListener(new SelectionListener() {
203
				
204
				@Override
205
				public void widgetSelected(SelectionEvent e) {
206
					if (nbwords > 0) addLinkField();
207
					addWordField();
208
					parent.layout(true);
209
					mainPanel.layout(true);
210
					wordcontainer.layout(true);
211
					scrollComposite.layout(true);
212
					mainPanel.update();
213
					wordcontainer.update();
214
					Rectangle r = scrollComposite.getClientArea();
215
					scrollComposite.setMinSize(wordcontainer.computeSize(r.width, SWT.DEFAULT));
216
					updateShell();
217
				}
218
				
219
				@Override
220
				public void widgetDefaultSelected(SelectionEvent e) {}
221
			});
222
			
223
			
193 224
			Composite withinComposite = new Composite(mainPanel, SWT.NONE);
194 225
			withinComposite.setLayout(new GridLayout(3, false));
195 226
			withinComposite.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false, 2, 1));
......
239 270
				}
240 271
			}
241 272
			
242
			Button addwordButton = new Button(mainPanel, SWT.PUSH);
243
			addwordButton.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false));
244
			addwordButton.setText(TXMUIMessages.addAWord);
245
			addwordButton.addSelectionListener(new SelectionListener() {
246
				
247
				@Override
248
				public void widgetSelected(SelectionEvent e) {
249
					if (nbwords > 0) addLinkField();
250
					addWordField();
251
					parent.layout(true);
252
					mainPanel.layout(true);
253
					wordcontainer.layout(true);
254
					scrollComposite.layout(true);
255
					mainPanel.update();
256
					wordcontainer.update();
257
					Rectangle r = scrollComposite.getClientArea();
258
					scrollComposite.setMinSize(wordcontainer.computeSize(r.width, SWT.DEFAULT));
259
					updateShell();
260
				}
261
				
262
				@Override
263
				public void widgetDefaultSelected(SelectionEvent e) {}
264
			});
265 273
			
266 274
			// Button removeWordButton = new Button(mainPanel, SWT.PUSH);
267 275
			// removeWordButton.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false));
......
525 533
		private int no;
526 534
		
527 535
		private Button allCriteriaButton;
536

  
537
		private Label allCriteriaLabel;
528 538
		
529 539
		
530 540
		/**
......
537 547
		public WordField(Composite parent, int style, int no) {
538 548
			super(parent, style);
539 549
			this.no = no;
540
			this.setLayout(new GridLayout(8, false));
550
			this.setLayout(new GridLayout(9, false));
541 551
			
542 552
			titleL = new Label(this, SWT.NONE);
543 553
			
......
582 592
			propertiesFieldComposite.setLayoutData(propertiesvlayout);
583 593
			propertiesFieldComposite.getLayout().numColumns = 2;
584 594
			
595
			allCriteriaLabel = new Label(this, SWT.NONE);
596
			allCriteriaLabel.setText("  ");
597
			
585 598
			allCriteriaButton = new Button(this, SWT.CHECK);
586 599
			allCriteriaButton.setToolTipText("All property tests are verified");
600
			allCriteriaButton.setSelection(true);
587 601
			
602
			new Label(this, SWT.NONE).setText("@");
603
			
588 604
			targetButton = new Button(this, SWT.CHECK);
589 605
			targetButton.setToolTipText("Check to target the word in the query");
590 606
			targetButton.addSelectionListener(new SelectionListener() {
......
659 675
		private void updateWidgets() {
660 676
			
661 677
			allCriteriaButton.setEnabled(propertyFields.size() > 1);
678
			allCriteriaButton.setVisible(propertyFields.size() > 1);
679
			if (allCriteriaButton.isEnabled()) {
680
				allCriteriaLabel.setText("&&");
681
			} else {
682
				allCriteriaLabel.setText("  ");
683
			}
662 684
			// propertiesAllOrOne.setVisible(propertyFields.size() > 1);
663 685
			// ((GridData)propertiesAllOrOne.getLayoutData()).exclude = propertyFields.size() < 2;
664 686
			if (propertyFields.size() == 0) {

Formats disponibles : Unified diff