Révision 3601

TXM/trunk/org.txm.concordance.core/src/org/txm/concordance/core/functions/Line.java (revision 3601)
304 304
		int start = this.getLeftContextSize() - max;
305 305
		for (int i = start; i < this.getLeftContextSize(); i++) {
306 306
			List<String> word = new ArrayList<>();
307
			for (Property property : concordance.getLeftViewProperties()) {
307
			for (Property property : values.keySet()) {
308 308
				List<String> ivalues = values.get(property);
309 309
				if (ivalues == null) {
310 310
					System.out.println("ERROR: null ivalues in " + values + " for property " + property);
......
357 357
		// System.out.println("Build STR of currentpos="+currentPos+" length="+s);
358 358
		for (int i = 0; i < s; i++) {
359 359
			List<String> word = new ArrayList<>();
360
			for (Property property : concordance.getKeywordViewProperties())
360
			for (Property property : values.keySet())
361 361
				word.add(values.get(property).get(i));
362 362
			
363 363
			if (currentPos == targetpos) { // highlight the @ target
......
413 413
		// System.out.println("Line "+keywordToString()+" right context, currentpos="+currentPos+" keywordpos="+keywordpos+" keywordlength="+s);
414 414
		for (int i = 0; i < max; i++) {
415 415
			List<String> word = new ArrayList<>();
416
			for (Property property : concordance.getRightViewProperties())
416
			for (Property property : values.keySet())
417 417
				word.add(values.get(property).get(i));
418 418
			words.add(StringUtils.join(word, propertySeparator));
419 419
			
......
445 445
		
446 446
		for (int i = 0; i < max; i++) {
447 447
			List<String> word = new ArrayList<>();
448
			for (Property property : concordance.getRightViewProperties()) {
448
			for (Property property : values.keySet()) {
449 449
				// if(propertiesToProcess.contains(property.getName()))
450 450
				// word.add(TxmRenderer.jseshrenderer.render(values.get(property).get(i)));
451 451
				// else
......
472 472
		for (int i = 0; i < values.get(
473 473
				concordance.getKeywordViewProperties().get(0)).size(); i++) {
474 474
			List<String> word = new ArrayList<>();
475
			for (Property property : concordance.getKeywordViewProperties()) {
475
			for (Property property : values.keySet()) {
476 476
				// if(propertiesToProcess.contains(property.getName()))
477 477
				// word.add(TxmRenderer.jseshrenderer.render(values.get(property).get(i)));
478 478
				// else
......
498 498
		int start = this.getLeftContextSize() - max;
499 499
		for (int i = start; i < this.getLeftContextSize(); i++) {
500 500
			List<String> word = new ArrayList<>();
501
			for (Property property : concordance.getLeftViewProperties()) {
501
			for (Property property : values.keySet()) {
502 502
				// if(propertiesToProcess.contains(property.getName()))
503 503
				// word.add(TxmRenderer.jseshrenderer.render(values.get(property).get(i)));
504 504
				// else
......
598 598
	 * @throws CqiClientException the cqi client exception
599 599
	 */
600 600
	public List<String> matchGetId(CQPCorpus corpus) throws CqiClientException {
601
		
601 602
		return org.txm.searchengine.cqp.corpus.query.Match.getValuesForProperty(corpus.getProperty("id"), match); //$NON-NLS-1$
602 603
	}
603 604
	
......
609 610
	 * @return the list
610 611
	 * @throws CqiClientException the cqi client exception
611 612
	 */
612
	public List<String> matchGetId(CQPCorpus corpus, int[] positions)
613
			throws CqiClientException {
613
	public List<String> matchGetId(CQPCorpus corpus, int[] positions) throws CqiClientException {
614
		
614 615
		return org.txm.searchengine.cqp.corpus.query.Match.getValuesForProperty(corpus.getProperty("id"), positions); //$NON-NLS-1$
615 616
	}
616 617
	
......
623 624
	 * @return the list
624 625
	 * @throws CqiClientException the cqi client exception
625 626
	 */
626
	public List<String> matchGetPropertie(CQPCorpus corpus, String property,
627
			int[] positions) throws CqiClientException {
627
	public List<String> matchGetPropertie(CQPCorpus corpus, String property, int[] positions) throws CqiClientException {
628
		
628 629
		return org.txm.searchengine.cqp.corpus.query.Match.getValuesForProperty(corpus.getProperty(property), positions);
629 630
	}
630 631
	
......
637 638
	 * @return the list
638 639
	 * @throws CqiClientException the cqi client exception
639 640
	 */
640
	public List<String> matchGetProperties(CQPCorpus corpus, Property property,
641
			int[] positions) throws CqiClientException {
641
	public List<String> matchGetProperties(CQPCorpus corpus, Property property, int[] positions) throws CqiClientException {
642
		
642 643
		return org.txm.searchengine.cqp.corpus.query.Match.getValuesForProperty(property, positions);
643 644
	}
644 645
	
TXM/trunk/org.txm.concordance.core/src/org/txm/concordance/core/functions/Concordance.java (revision 3601)
214 214
	public boolean loadParameters() {
215 215
		
216 216
		try {
217
			
218 217
			this.pQuery = IQuery.fromPrefString(this.getStringParameterValue(ConcordancePreferences.QUERY));
219 218
			
220 219
			this.setCQLSeparator(this.getCorpus().getCQLLimitQuery());
221 220
			
222
			
223 221
			// this.pTopIndex = this.getIntParameterValue(ConcordancePreferences.TOP_INDEX);
224 222
			// this.pNLinesPerPage = this.getIntParameterValue(ConcordancePreferences.N_LINE_PER_PAGE);
225 223
			//
......
774 772
				
775 773
				// System.out.println("RIGHT ctx lengths: "+lengthOfRightCtx);
776 774
				// get all view property values of all lines
777
				Map<Property, List<List<String>>> keywordsViewPropValues = new HashMap<>();
778
				Map<Property, List<List<String>>> leftCtxViewPropValues = new HashMap<>();
779
				Map<Property, List<List<String>>> rightCtxViewPropValues = new HashMap<>();
775
				Map<Property, List<List<String>>> keywordsViewPropValues = new LinkedHashMap<>();
776
				Map<Property, List<List<String>>> leftCtxViewPropValues = new LinkedHashMap<>();
777
				Map<Property, List<List<String>>> rightCtxViewPropValues = new LinkedHashMap<>();
780 778
				for (Property property : pViewLeftProperties) {
781 779
					leftCtxViewPropValues.put(property, cqiClient.getData(property, beginingOfLeftCtxPositions,
782 780
							lengthOfLeftCtx));
......
789 787
				}
790 788
				
791 789
				// get all analysis property values of all lines
792
				HashMap<Property, List<List<String>>> leftCtxAnaPropValues = new HashMap<>();
790
				HashMap<Property, List<List<String>>> leftCtxAnaPropValues = new LinkedHashMap<>();
793 791
				for (Property p : pAnalysisLeftProperties) {
794 792
					leftCtxAnaPropValues.put(p, cqiClient.getData(p, beginingOfLeftCtxPositions, lengthOfLeftCtx));
795 793
				}
796
				HashMap<Property, List<List<String>>> keywordsAnaPropValues = new HashMap<>();
794
				HashMap<Property, List<List<String>>> keywordsAnaPropValues = new LinkedHashMap<>();
797 795
				for (Property p : pAnalysisKeywordProperties) {
798 796
					keywordsAnaPropValues.put(p, cqiClient.getData(p, beginingOfKeywordsPositions, lengthOfKeywords));
799 797
				}
800
				HashMap<Property, List<List<String>>> rightCtxAnaPropValues = new HashMap<>();
798
				HashMap<Property, List<List<String>>> rightCtxAnaPropValues = new LinkedHashMap<>();
801 799
				for (Property p : pAnalysisRightProperties) {
802 800
					rightCtxAnaPropValues.put(p, cqiClient.getData(p, beginingOfRightCtxPositions, lengthOfRightCtx));
803 801
				}
804 802
				// get all view reference values of all lines
805
				Map<Property, List<List<String>>> refValues = new HashMap<>();
803
				Map<Property, List<List<String>>> refValues = new LinkedHashMap<>();
806 804
				for (Property property : pViewRefPattern) {
807 805
					refValues.put(property, cqiClient.getData(property,
808 806
							beginingOfKeywordsPositions,
......
810 808
				}
811 809
				
812 810
				// get all sort reference values of all lines
813
				Map<Property, List<List<String>>> refSortValues = new HashMap<>();
811
				Map<Property, List<List<String>>> refSortValues = new LinkedHashMap<>();
814 812
				for (Property property : pAnalysisRefPattern) {
815 813
					refSortValues.put(property, cqiClient.getData(property, beginingOfKeywordsPositions,
816 814
							Collections.nCopies(beginingOfKeywordsPositions.size(), 1)));
......
843 841
				for (int k = 0; k < j - i; k++) {
844 842
					// worked(1);
845 843
					// get the kth line's analysis property values
846
					HashMap<Property, List<String>> lineLeftCtxAnaPropValue = new HashMap<>();
844
					HashMap<Property, List<String>> lineLeftCtxAnaPropValue = new LinkedHashMap<>();
847 845
					for (Property p : pAnalysisLeftProperties) {
848 846
						lineLeftCtxAnaPropValue.put(p, leftCtxAnaPropValues.get(p).get(k));
849 847
					}
850
					HashMap<Property, List<String>> lineKeywordsAnaPropValue = new HashMap<>();
848
					HashMap<Property, List<String>> lineKeywordsAnaPropValue = new LinkedHashMap<>();
851 849
					for (Property p : pAnalysisKeywordProperties) {
852 850
						lineKeywordsAnaPropValue.put(p, keywordsAnaPropValues.get(p).get(k));
853 851
					}
854
					HashMap<Property, List<String>> lineRightCtxAnaPropValue = new HashMap<>();
852
					HashMap<Property, List<String>> lineRightCtxAnaPropValue = new LinkedHashMap<>();
855 853
					for (Property p : pAnalysisRightProperties) {
856 854
						lineRightCtxAnaPropValue.put(p, rightCtxAnaPropValues.get(p).get(k));
857 855
					}
858 856
					// get the kth line's view property values
859
					Map<Property, List<String>> lineLeftCtxViewPropValue = new HashMap<>();
860
					Map<Property, List<String>> lineKeywordsViewPropValue = new HashMap<>();
861
					Map<Property, List<String>> lineRightCtxViewPropValue = new HashMap<>();
857
					Map<Property, List<String>> lineLeftCtxViewPropValue = new LinkedHashMap<>();
858
					Map<Property, List<String>> lineKeywordsViewPropValue = new LinkedHashMap<>();
859
					Map<Property, List<String>> lineRightCtxViewPropValue = new LinkedHashMap<>();
862 860
					for (Property property : pViewLeftProperties) {
863 861
						lineLeftCtxViewPropValue.put(property, leftCtxViewPropValues.get(property).get(k));
864 862
					}

Formats disponibles : Unified diff