Révision 2711

tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/MainCorpus.java (revision 2711)
75 75
	protected File registryFile;
76 76
	
77 77
	/**
78
	 * CQP text ids cache
79
	 */
80
	protected String[] cqpTextIDS = null;
81
	
82
	/**
78 83
	 * <del>Instantiates a new sub corpus</del>
79 84
	 * 
80 85
	 * @param partition the parent partition -> only used for subcorpus
......
124 129
	@Override
125 130
	protected boolean __compute(TXMProgressMonitor monitor) throws Exception {
126 131
		
132
		
133
		
127 134
		if (!CQPSearchEngine.isInitialized()) {
128 135
			Log.warning("** TXM can't load MainCorpus when CQP search engine is not ready.");
129 136
			return false;
......
142 149
		}
143 150
		CorpusManager.getCorpusManager().add(this);
144 151
		
152
		cqpTextIDS = null; // reset CQP text ids
153
		
145 154
		this.dataDirectory = new File(getProjectDirectory(), "data/" + getID());
146 155
		this.registryFile = new File(getProjectDirectory(), "registry/" + getID().toLowerCase());
147 156
		
......
683 692
	 */
684 693
	@Override
685 694
	public String[] getCorpusTextIdsList() throws CqiClientException, IOException, CqiServerError {
686
		
687
		int nbtext = getNbTexts();
688
		int[] structs = new int[nbtext];
689
		for (int i = 0; i < nbtext; i++)
690
			structs[i] = i;
691
		
692
		StructuralUnit text_su = this.getStructuralUnit("text"); //$NON-NLS-1$
693
		StructuralUnitProperty text_id_sup = text_su.getProperty("id"); //$NON-NLS-1$
694
		
695
		return CorpusManager.getCorpusManager().getCqiClient().struc2Str(text_id_sup.getQualifiedName(), structs);
695
		if (cqpTextIDS == null) {
696
			
697
			int nbtext = getNbTexts();
698
			int[] structs = new int[nbtext];
699
			for (int i = 0; i < nbtext; i++) {
700
				structs[i] = i;
701
			}
702
			StructuralUnit text_su = this.getStructuralUnit("text"); //$NON-NLS-1$
703
			StructuralUnitProperty text_id_sup = text_su.getProperty("id"); //$NON-NLS-1$
704
			
705
			cqpTextIDS = CorpusManager.getCorpusManager().getCqiClient().struc2Str(text_id_sup.getQualifiedName(), structs);
706
		}
707
		return cqpTextIDS;
696 708
	}
697 709
	
698 710
	/**
tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/Subcorpus.java (revision 2711)
77 77
	protected SelectionResult selectionResult;
78 78
	
79 79
	/**
80
	 * CQP text ids cache
81
	 */
82
	protected String[] cqpTextIDS = null;
83
	
84
	/**
80 85
	 * 
81 86
	 * @param corpus
82 87
	 */
......
125 130
			
126 131
			this.qresult = new QueryResult(this.pID, this.userName, this.getCorpusParent(), this.pQuery); // getCorpusParent().query(pQuery, this.pID, true);
127 132
		}
133
		
134
		cqpTextIDS = null; // reset text ids cache
135
		
128 136
		return qresult != null;
129 137
	}
130 138
	
......
683 691
	@Override
684 692
	public String[] getCorpusTextIdsList() throws CqiClientException, IOException, CqiServerError {
685 693
		
686
		StructuralUnit text_su = this.getStructuralUnit("text"); //$NON-NLS-1$
687
		StructuralUnitProperty text_id_sup = text_su.getProperty("id"); //$NON-NLS-1$
688
		
689
		List<Integer> list = getTextNumberInCorpus();
690
		int[] structs = new int[list.size()];
691
		for (int i = 0; i < list.size(); i++) {
692
			structs[i] = list.get(i);
694
		if (cqpTextIDS == null) {
695
			StructuralUnit text_su = this.getStructuralUnit("text"); //$NON-NLS-1$
696
			StructuralUnitProperty text_id_sup = text_su.getProperty("id"); //$NON-NLS-1$
697
			
698
			List<Integer> list = getTextNumberInCorpus();
699
			int[] structs = new int[list.size()];
700
			for (int i = 0; i < list.size(); i++) {
701
				structs[i] = list.get(i);
702
			}
703
			
704
			cqpTextIDS = CorpusManager.getCorpusManager().getCqiClient().struc2Str(text_id_sup.getQualifiedName(), structs);
693 705
		}
694
		
695
		return CorpusManager.getCorpusManager().getCqiClient().struc2Str(text_id_sup.getQualifiedName(), structs);
706
		return cqpTextIDS;
696 707
	}
697 708
	
698 709
	/**

Formats disponibles : Unified diff