Revision 1143
tmp/org.txm.queryindex.rcp/src/org/txm/functions/queryindex/QueryIndex.java (revision 1143) | ||
---|---|---|
322 | 322 |
|
323 | 323 |
try { |
324 | 324 |
LexicalTableImpl lt = new LexicalTableImpl(freqs, rownames, colnames); |
325 |
LexicalTable table = new LexicalTable(partition, partition.getProperty(), 1, this.getV(), lt); |
|
325 |
LexicalTable table = new LexicalTable(partition, partition.getCorpus().getDefaultProperty(), 1, this.getV(), lt);
|
|
326 | 326 |
return table; |
327 | 327 |
} catch (Exception e) { |
328 | 328 |
Log.printStackTrace(e); |
tmp/org.txm.queryindex.rcp/src/org/txm/queryindex/core/functions/QueryIndex.java (revision 1143) | ||
---|---|---|
322 | 322 |
|
323 | 323 |
try { |
324 | 324 |
LexicalTableImpl lt = new LexicalTableImpl(freqs, rownames, colnames); |
325 |
LexicalTable table = new LexicalTable(partition, partition.getProperty(), 1, this.getV(), lt); |
|
325 |
LexicalTable table = new LexicalTable(partition, partition.getCorpus().getDefaultProperty(), 1, this.getV(), lt);
|
|
326 | 326 |
return table; |
327 | 327 |
} catch (Exception e) { |
328 | 328 |
Log.printStackTrace(e); |
tmp/org.txm.core/src/java/org/txm/core/results/TXMResult.java (revision 1143) | ||
---|---|---|
344 | 344 |
return TXMPreferences.getDefaultScopeKeys(this.commandPreferencesNodePath); |
345 | 345 |
} |
346 | 346 |
|
347 |
|
|
347 |
/** |
|
348 |
* Gets a current parameter specified by its annotation "key" attribute and its annotation "type" attribute. |
|
349 |
* @param key |
|
350 |
* @param parameterType |
|
351 |
* @return |
|
352 |
*/ |
|
353 |
public Object getParameter(String key) { |
|
354 |
return getParameter(key, false); |
|
355 |
} |
|
348 | 356 |
|
349 | 357 |
/** |
350 | 358 |
* Gets a current parameter specified by its annotation "key" attribute and its annotation "type" attribute. |
351 | 359 |
* @param key |
360 |
* @bubble if true ask the first parent |
|
352 | 361 |
* @param parameterType |
353 | 362 |
* @return |
354 | 363 |
*/ |
355 |
public Object getParameter(String key) { |
|
364 |
public Object getParameter(String key, boolean bubble) {
|
|
356 | 365 |
try { |
357 | 366 |
Field field = this.getField(key); |
358 | 367 |
if(field != null) { |
359 | 368 |
field.setAccessible(true); |
360 | 369 |
return field.get(this); |
370 |
} else if (bubble) { |
|
371 |
return parent.getParameter(key, false); |
|
361 | 372 |
} |
362 | 373 |
} |
363 | 374 |
catch (IllegalArgumentException e) { |
... | ... | |
1085 | 1096 |
this.clean(); |
1086 | 1097 |
|
1087 | 1098 |
if (this.parent != null) { |
1088 |
this.parent.removeResult(this);
|
|
1099 |
this.parent.removeChild(this);
|
|
1089 | 1100 |
} |
1090 | 1101 |
this.parent = null; |
1091 | 1102 |
return true; |
... | ... | |
1135 | 1146 |
* @param child |
1136 | 1147 |
* @return true if the child has been added |
1137 | 1148 |
*/ |
1138 |
public boolean addChild(TXMResult child) {
|
|
1149 |
private boolean addChild(TXMResult child) {
|
|
1139 | 1150 |
try { |
1140 | 1151 |
// do nothing if the parent is already this result |
1141 | 1152 |
// if(child.getParent() == this) { |
... | ... | |
1166 | 1177 |
* @param child |
1167 | 1178 |
* @return |
1168 | 1179 |
*/ |
1169 |
public boolean addChild(int index, TXMResult child) {
|
|
1180 |
private boolean addChild(int index, TXMResult child) {
|
|
1170 | 1181 |
try { |
1171 | 1182 |
if (!this.children.contains(child)) { |
1172 | 1183 |
child.setParent(this); |
... | ... | |
1187 | 1198 |
* @param child |
1188 | 1199 |
* @return <code>true if the child has been removed, otherwise <code>false</code> |
1189 | 1200 |
*/ |
1190 |
public boolean removeResult(TXMResult child) {
|
|
1201 |
private boolean removeChild(TXMResult child) {
|
|
1191 | 1202 |
try { |
1192 | 1203 |
child.setParent(null); |
1193 | 1204 |
return this.children.remove(child); |
... | ... | |
1202 | 1213 |
* @param index |
1203 | 1214 |
* @return <code>true if the child has been removed, otherwise <code>false</code> |
1204 | 1215 |
*/ |
1205 |
public boolean removeChild(int index) {
|
|
1216 |
private boolean removeChild(int index) {
|
|
1206 | 1217 |
try { |
1207 |
return this.removeResult(this.children.get(index));
|
|
1218 |
return this.removeChild(this.children.get(index));
|
|
1208 | 1219 |
} catch (Exception e) { |
1209 | 1220 |
|
1210 | 1221 |
} |
... | ... | |
1216 | 1227 |
* |
1217 | 1228 |
* @return |
1218 | 1229 |
*/ |
1219 |
public boolean removeFromParent() {
|
|
1230 |
private boolean removeFromParent() {
|
|
1220 | 1231 |
try { |
1221 |
return this.parent.removeResult(this);
|
|
1232 |
return this.parent.removeChild(this);
|
|
1222 | 1233 |
} catch (Exception e) { |
1223 | 1234 |
|
1224 | 1235 |
} |
1225 | 1236 |
return false; |
1226 | 1237 |
} |
1227 | 1238 |
|
1228 |
|
|
1229 | 1239 |
/** |
1230 | 1240 |
* Gets all the children results (nor a clone). |
1231 | 1241 |
* |
... | ... | |
1876 | 1886 |
|
1877 | 1887 |
/** |
1878 | 1888 |
* |
1879 |
* @param update |
|
1880 |
* TODO |
|
1881 |
* @return |
|
1889 |
* @return true if the result was computed |
|
1890 |
* |
|
1882 | 1891 |
* @throws Exception |
1883 | 1892 |
*/ |
1884 | 1893 |
protected abstract boolean _compute() throws Exception; |
tmp/org.txm.internalview.core/src/org/txm/internalview/core/functions/InternalView.java (revision 1143) | ||
---|---|---|
57 | 57 |
*/ |
58 | 58 |
@Parameter(key=TXMPreferences.UNIT_PROPERTIES) |
59 | 59 |
protected List<WordProperty> pWordProperties; |
60 |
|
|
60 |
|
|
61 | 61 |
/** |
62 | 62 |
* Structural units to display. |
63 | 63 |
*/ |
64 | 64 |
@Parameter(key=TXMPreferences.STRUCTURAL_UNIT_PROPERTIES) |
65 | 65 |
protected List<StructuralUnitProperty> pStructuralUnitsProperties; |
66 |
|
|
67 |
|
|
66 |
|
|
67 |
|
|
68 | 68 |
/** |
69 | 69 |
* |
70 | 70 |
* @param parent |
... | ... | |
72 | 72 |
public InternalView(CQPCorpus parent) { |
73 | 73 |
super(parent); |
74 | 74 |
} |
75 |
|
|
75 |
|
|
76 | 76 |
/** |
77 | 77 |
* |
78 | 78 |
* @param parametersNodePath |
... | ... | |
81 | 81 |
super(parametersNodePath); |
82 | 82 |
} |
83 | 83 |
|
84 |
|
|
85 |
|
|
84 |
|
|
85 |
|
|
86 | 86 |
@Override |
87 | 87 |
public boolean loadParameters() throws Exception { |
88 | 88 |
try { |
89 | 89 |
String str = this.getStringParameterValue(TXMPreferences.STRUCTURAL_UNIT); |
90 | 90 |
this.pStructuralUnit = this.getCorpus().getStructuralUnit(str); |
91 |
str = this.getStringParameterValue(TXMPreferences.UNIT_PROPERTIES); |
|
92 |
this.pWordProperties = (List<WordProperty>) Property.stringToProperties(this.getCorpus(), str); |
|
93 |
str = this.getStringParameterValue(TXMPreferences.STRUCTURAL_UNIT_PROPERTIES); |
|
94 |
this.pStructuralUnitsProperties = StructuralUnitProperty.stringToProperties(this.getCorpus(), str); |
|
95 |
} catch (CqiClientException e) { |
|
91 |
} catch (Exception e) { |
|
96 | 92 |
Log.printStackTrace(e); |
97 |
return false; |
|
98 | 93 |
} |
94 |
try { |
|
95 |
String str = this.getStringParameterValue(TXMPreferences.UNIT_PROPERTIES); |
|
96 |
this.pWordProperties = (List<WordProperty>) WordProperty.stringToProperties(this.getCorpus(), str); |
|
97 |
} catch (Exception e2) { |
|
98 |
Log.printStackTrace(e2); |
|
99 |
} |
|
100 |
try { |
|
101 |
String str = this.getStringParameterValue(TXMPreferences.STRUCTURAL_UNIT_PROPERTIES); |
|
102 |
this.pStructuralUnitsProperties = StructuralUnitProperty.stringToProperties(this.getCorpus(), str); |
|
103 |
} catch (Exception e3) { |
|
104 |
Log.printStackTrace(e3); |
|
105 |
} |
|
99 | 106 |
return true; |
100 | 107 |
} |
101 | 108 |
|
102 |
|
|
109 |
|
|
103 | 110 |
@Override |
104 | 111 |
protected boolean _compute() throws Exception { |
105 | 112 |
|
106 | 113 |
//if(this.hasParameterChanged(InternalViewPreferences.STRUCTURAL_UNIT)) { |
107 |
this.pCurrentPage = 0;
|
|
108 |
//find struct start-end
|
|
109 |
CQLQuery query = new CQLQuery("<" + pStructuralUnit.getName() + "> [] expand to " + pStructuralUnit); //$NON-NLS-1$ //$NON-NLS-2$
|
|
110 |
//System.out.println(query);
|
|
111 |
QueryResult result = getCorpus().query(query, "test", false); //$NON-NLS-1$
|
|
112 |
nmatches = result.getNMatch();
|
|
113 |
if (nmatches > 0) {
|
|
114 |
matches = result.getMatches();
|
|
115 |
}
|
|
116 |
result.drop();
|
|
117 |
//System.out.println(matches);
|
|
118 |
dirty = false;
|
|
119 |
return (nmatches > 0);
|
|
114 |
this.pCurrentPage = 0; |
|
115 |
//find struct start-end |
|
116 |
CQLQuery query = new CQLQuery("<" + pStructuralUnit.getName() + "> [] expand to " + pStructuralUnit); //$NON-NLS-1$ //$NON-NLS-2$ |
|
117 |
//System.out.println(query); |
|
118 |
QueryResult result = getCorpus().query(query, "test", false); //$NON-NLS-1$ |
|
119 |
nmatches = result.getNMatch(); |
|
120 |
if (nmatches > 0) { |
|
121 |
matches = result.getMatches(); |
|
122 |
} |
|
123 |
result.drop(); |
|
124 |
//System.out.println(matches); |
|
125 |
dirty = false; |
|
126 |
return (nmatches > 0); |
|
120 | 127 |
//} |
121 |
|
|
128 |
|
|
122 | 129 |
} |
123 |
|
|
124 |
|
|
125 | 130 |
|
126 |
|
|
131 |
|
|
132 |
|
|
133 |
|
|
127 | 134 |
@Override |
128 | 135 |
public boolean canCompute() { |
129 | 136 |
return getCorpus() != null && |
... | ... | |
133 | 140 |
pStructuralUnitsProperties != null && |
134 | 141 |
pStructuralUnitsProperties.size() > 0; |
135 | 142 |
} |
136 |
|
|
143 |
|
|
137 | 144 |
/** |
138 | 145 |
* get the ith page and set the current page number to i |
139 | 146 |
* |
... | ... | |
159 | 166 |
} |
160 | 167 |
return rez; |
161 | 168 |
} |
162 |
|
|
163 | 169 |
|
170 |
|
|
164 | 171 |
/** |
165 | 172 |
* |
166 | 173 |
* @return the current page content map |
... | ... | |
171 | 178 |
return current; |
172 | 179 |
} |
173 | 180 |
|
174 |
|
|
175 |
|
|
176 |
|
|
181 |
|
|
182 |
|
|
183 |
|
|
177 | 184 |
/** |
178 | 185 |
* Gets the current page number. |
179 | 186 |
* @return the current page number |
... | ... | |
181 | 188 |
public int getCurrentPage() { |
182 | 189 |
return pCurrentPage; |
183 | 190 |
} |
184 |
|
|
191 |
|
|
185 | 192 |
@Override |
186 | 193 |
public boolean saveParameters() { |
187 | 194 |
if (pStructuralUnit != null) { |
... | ... | |
194 | 201 |
if (pWordProperties != null) { |
195 | 202 |
this.saveParameter(InternalViewPreferences.UNIT_PROPERTIES, WordProperty.propertiesToString(pWordProperties)); |
196 | 203 |
} |
197 |
|
|
204 |
|
|
198 | 205 |
return true; |
199 | 206 |
} |
200 |
|
|
207 |
|
|
201 | 208 |
@Override |
202 | 209 |
public void clean() { |
203 | 210 |
// nothing to do |
... | ... | |
212 | 219 |
return (CQPCorpus)getParent(); |
213 | 220 |
} |
214 | 221 |
|
215 |
|
|
222 |
|
|
216 | 223 |
@Override |
217 | 224 |
public String getDetails() { |
218 | 225 |
return getCorpus().getName()+" "+pStructuralUnit.getName()+" "+(pCurrentPage+1); //$NON-NLS-1$ //$NON-NLS-2$ |
... | ... | |
224 | 231 |
return getName(); |
225 | 232 |
} |
226 | 233 |
|
227 |
|
|
234 |
|
|
228 | 235 |
@Override |
229 | 236 |
public String getName() { |
230 | 237 |
if (pStructuralUnit != null) { |
... | ... | |
262 | 269 |
if (matches.size() < pCurrentPage) { |
263 | 270 |
return 0; |
264 | 271 |
} |
265 |
|
|
272 |
|
|
266 | 273 |
Match m = matches.get(pCurrentPage); |
267 | 274 |
return m.size(); |
268 | 275 |
} |
... | ... | |
317 | 324 |
System.out.println(); |
318 | 325 |
} |
319 | 326 |
|
320 |
|
|
327 |
|
|
321 | 328 |
public void setParameters(List<WordProperty> properties, StructuralUnit struct, List<StructuralUnitProperty> structProperties, Integer currentStructure) { |
322 | 329 |
if (properties != null) this.pWordProperties = properties; |
323 | 330 |
if (struct != null) this.pStructuralUnit = struct; |
324 | 331 |
if (structProperties != null) this.pStructuralUnitsProperties = structProperties; |
325 | 332 |
if (currentStructure != null) this.pCurrentPage = currentStructure; |
326 |
|
|
333 |
|
|
327 | 334 |
dirty = true; |
328 | 335 |
} |
329 | 336 |
|
330 | 337 |
|
331 | 338 |
|
332 |
|
|
339 |
|
|
333 | 340 |
@Override |
334 | 341 |
public boolean setParameters(TXMParameters parameters) { |
335 | 342 |
// FIXME: Debug |
... | ... | |
352 | 359 |
return false; |
353 | 360 |
} |
354 | 361 |
|
355 |
|
|
362 |
|
|
356 | 363 |
/** |
357 | 364 |
* Sets the structural unit to explore. |
358 | 365 |
* @param structuralUnit |
... | ... | |
369 | 376 |
public void setWordProperties(List<WordProperty> properties) { |
370 | 377 |
this.pWordProperties = properties; |
371 | 378 |
} |
372 |
|
|
379 |
|
|
373 | 380 |
/** |
374 | 381 |
* Sets the structural unit properties to display. |
375 | 382 |
* @param structuralUnitProperties |
... | ... | |
385 | 392 |
*/ |
386 | 393 |
public void setCurrentPage(int currentPage) { |
387 | 394 |
this.pCurrentPage = currentPage; |
388 |
|
|
395 |
|
|
389 | 396 |
if(this.pCurrentPage < 0 || this.pCurrentPage > (this.nmatches - 1)) { |
390 | 397 |
System.err.println("InternalView.canCompute(): current page (" + this.pCurrentPage + ") is outside matches range (" + this.nmatches + ")."); |
391 | 398 |
this.pCurrentPage = 0; |
tmp/org.txm.tigersearch.rcp/src/org/txm/tigersearch/editors/TSIndexEditor.java (revision 1143) | ||
---|---|---|
313 | 313 |
this.runInit(monitor); |
314 | 314 |
try { |
315 | 315 |
JobsTimer.start(); |
316 |
if (index != null) { |
|
317 |
corpus.removeResult(index); |
|
318 |
index = null; |
|
319 |
} |
|
316 |
// if (index != null) {
|
|
317 |
// corpus.removeResult(index);
|
|
318 |
// index = null;
|
|
319 |
// }
|
|
320 | 320 |
|
321 | 321 |
System.out.println(title); |
322 | 322 |
Log.info("Start computing TSIndex..."); |
tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/Partition.java (revision 1143) | ||
---|---|---|
117 | 117 |
super(parametersNodePath); |
118 | 118 |
} |
119 | 119 |
|
120 |
public CQPCorpus getCorpus() { |
|
121 |
return (CQPCorpus) parent; |
|
122 |
} |
|
123 |
|
|
120 | 124 |
/** |
121 | 125 |
* Instantiates a new partition. |
122 | 126 |
* |
... | ... | |
145 | 149 |
partName = "-"; //$NON-NLS-1$ |
146 | 150 |
} |
147 | 151 |
|
148 |
this.addChild(new Part(this, partName, queryS)); |
|
152 |
new Part(this, partName, queryS); |
|
153 |
//this.addChild(); |
|
149 | 154 |
} |
150 | 155 |
long end = System.currentTimeMillis(); |
151 | 156 |
Log.info(NLS.bind(TXMCoreMessages.info_partitionCreatedInXMs, this.userName, (end - start))); |
tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/CQPCorpus.java (revision 1143) | ||
---|---|---|
1119 | 1119 |
* @return |
1120 | 1120 |
* @throws CqiClientException |
1121 | 1121 |
*/ |
1122 |
public Property getDefaultProperty() throws CqiClientException { |
|
1122 |
public WordProperty getDefaultProperty() throws CqiClientException {
|
|
1123 | 1123 |
return this.getProperty(WORD); |
1124 | 1124 |
} |
1125 | 1125 |
|
tmp/org.txm.specificities.core/src/org/txm/specificities/core/functions/Specificities.java (revision 1143) | ||
---|---|---|
50 | 50 |
import org.txm.searchengine.cqp.corpus.CQPCorpus; |
51 | 51 |
import org.txm.searchengine.cqp.corpus.Partition; |
52 | 52 |
import org.txm.searchengine.cqp.corpus.Property; |
53 |
import org.txm.searchengine.cqp.corpus.WordProperty; |
|
53 | 54 |
import org.txm.specificities.core.messages.SpecificitiesCoreMessages; |
54 | 55 |
import org.txm.specificities.core.preferences.SpecificitiesPreferences; |
55 | 56 |
import org.txm.specificities.core.statsengine.r.function.SpecificitiesR; |
... | ... | |
121 | 122 |
|
122 | 123 |
|
123 | 124 |
|
124 |
/** |
|
125 |
* Unit property. |
|
126 |
*/ |
|
127 |
@Parameter(key=TXMPreferences.UNIT_PROPERTY) |
|
128 |
protected Property unitProperty; |
|
125 |
// /**
|
|
126 |
// * Unit property.
|
|
127 |
// */
|
|
128 |
// @Parameter(key=TXMPreferences.UNIT_PROPERTY)
|
|
129 |
// protected Property unitProperty;
|
|
129 | 130 |
|
130 | 131 |
/** |
131 | 132 |
* Maximum score. |
... | ... | |
170 | 171 |
@Override |
171 | 172 |
public boolean loadParameters() { |
172 | 173 |
this.lexicalTable = (LexicalTable) this.parent; |
173 |
this.unitProperty = this.lexicalTable.getProperty(); |
|
174 |
//this.unitProperty = this.lexicalTable.getProperty();
|
|
174 | 175 |
this.lexicalTable.setVMaxFilter(Integer.MAX_VALUE); |
175 | 176 |
return true; |
176 | 177 |
} |
... | ... | |
197 | 198 |
// } |
198 | 199 |
|
199 | 200 |
// delete the specificities selection chart children since they can not be valid anymore |
200 |
if(this.needsFullRecomputing || this.hasParameterChanged(TBXPreferences.UNIT_PROPERTY)) { |
|
201 |
if (this.needsFullRecomputing || this.hasParameterChanged(TBXPreferences.UNIT_PROPERTY)) {
|
|
201 | 202 |
this.deleteChildren(SpecificitiesSelection.class); |
202 | 203 |
} |
203 | 204 |
|
204 | 205 |
|
205 | 206 |
// essentially for cascade computing from the parent lexical table |
206 |
this.unitProperty = this.lexicalTable.getProperty(); |
|
207 |
// this.unitProperty = this.lexicalTable.getProperty();
|
|
207 | 208 |
|
208 |
if(this.lexicalTable.hasBeenComputedOnce()) { |
|
209 |
if (this.lexicalTable.hasBeenComputedOnce()) {
|
|
209 | 210 |
SpecificitiesR rSpecificities = new SpecificitiesR(this.lexicalTable.getData()); |
210 | 211 |
double[][] specIndex = rSpecificities.getScores(); |
211 | 212 |
|
212 | 213 |
if (this.lexicalTable.getPartition() != null) { |
213 |
init(symbol, specIndex, this.unitProperty.getName());
|
|
214 |
init(symbol, specIndex, this.lexicalTable.getProperty().getName());
|
|
214 | 215 |
} |
215 | 216 |
else { |
216 |
init(rSpecificities.getSymbol(), specIndex, "TLNONAME: " + this.unitProperty.getName()); //$NON-NLS-1$
|
|
217 |
init(rSpecificities.getSymbol(), specIndex, "TLNONAME: " + this.lexicalTable.getProperty()); //$NON-NLS-1$
|
|
217 | 218 |
} |
218 | 219 |
} |
219 | 220 |
|
... | ... | |
338 | 339 |
* Sets the unit property. |
339 | 340 |
* @param unitProperty |
340 | 341 |
*/ |
341 |
public void setUnitProperty(Property unitProperty) { |
|
342 |
this.unitProperty = unitProperty;
|
|
342 |
public void setUnitProperty(WordProperty unitProperty) {
|
|
343 |
this.getLexicalTable().setUnitProperty(unitProperty);
|
|
343 | 344 |
} |
344 | 345 |
|
345 | 346 |
|
... | ... | |
389 | 390 |
* @throws StatException the stat exception |
390 | 391 |
*/ |
391 | 392 |
public int getCorpusSize() throws StatException { |
392 |
return lexicalTable != null ? lexicalTable.getData().getTotal() : lexicon.nbrOfToken(); |
|
393 |
return lexicalTable.getData() != null ? lexicalTable.getData().getTotal() : lexicon.nbrOfToken();
|
|
393 | 394 |
} |
394 | 395 |
|
395 | 396 |
/** |
... | ... | |
714 | 715 |
Log.severe("Specificities.canCompute(): can not compute without a lexical table."); |
715 | 716 |
return false; |
716 | 717 |
} |
717 |
else if(this.unitProperty == null) { |
|
718 |
Log.severe("Specificities.canCompute(): can not compute with no unit property."); //$NON-NLS-1$ |
|
719 |
return false; |
|
720 |
} |
|
721 |
|
|
718 |
|
|
722 | 719 |
// if (this.lexicalTable.getNColumns() < 2) { |
723 | 720 |
// Log.severe(SpecificitiesCoreMessages.ComputeError_NEED_AT_LEAST_2_PARTS); |
724 | 721 |
// return false; |
... | ... | |
756 | 753 |
* @return the unitProperty |
757 | 754 |
*/ |
758 | 755 |
public Property getUnitProperty() { |
759 |
return unitProperty;
|
|
756 |
return getLexicalTable().getProperty();
|
|
760 | 757 |
} |
761 | 758 |
|
762 | 759 |
@Override |
tmp/org.txm.lexicaltable.rcp/src/org/txm/lexicaltable/rcp/handlers/ComputeLexicalTable.java (revision 1143) | ||
---|---|---|
143 | 143 |
} |
144 | 144 |
} |
145 | 145 |
|
146 |
final Property property = properties.get(0); |
|
146 |
final WordProperty property = properties.get(0);
|
|
147 | 147 |
|
148 | 148 |
lexicalTable = new LexicalTable(firstIndex); |
149 | 149 |
lexicalTable.setUseAllOccurrences(useAllOccurrences); |
tmp/org.txm.specificities.rcp/plugin.xml (revision 1143) | ||
---|---|---|
60 | 60 |
</command> |
61 | 61 |
</menuContribution> |
62 | 62 |
<menuContribution |
63 |
locationURI="menu:menu.tools?after=menu.tools.separator.stats">
|
|
63 |
locationURI="menu:menu.tools"> |
|
64 | 64 |
<command |
65 | 65 |
commandId="org.txm.specificities.rcp.handlers.ComputeSpecifities" |
66 | 66 |
icon="icons/functions/specificities.png" |
tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/TXMEditor.java (revision 1143) | ||
---|---|---|
745 | 745 |
// FIXME: debug test to not draw while updating the widgets |
746 | 746 |
this.getContainer().setRedraw(false); |
747 | 747 |
|
748 |
|
|
749 | 748 |
this.setPartName(this.getResult().getName()); |
750 | 749 |
this.firePropertyChange(TXMEditor.PROP_DIRTY); |
751 | 750 |
|
... | ... | |
852 | 851 |
try { |
853 | 852 |
f.setAccessible(true); |
854 | 853 |
Object object = f.get(this); |
855 |
Object value = this.getResult().getParameter(parameter.key());
|
|
854 |
Object value = this.getResult().getParameter(parameter.key(), true); // get the parent value if necessary
|
|
856 | 855 |
if(object instanceof ToolItem) { |
857 | 856 |
((ToolItem)object).setSelection((Boolean) value); |
858 | 857 |
} |
tmp/org.txm.ca.rcp/src/org/txm/ca/rcp/editors/CAParametersDialog.java (revision 1143) | ||
---|---|---|
50 | 50 |
import org.txm.searchengine.cqp.clientExceptions.CqiClientException; |
51 | 51 |
import org.txm.searchengine.cqp.corpus.CQPCorpus; |
52 | 52 |
import org.txm.searchengine.cqp.corpus.Property; |
53 |
import org.txm.searchengine.cqp.corpus.WordProperty; |
|
53 | 54 |
/** |
54 | 55 |
* Retrieve the property analysis to be used for computing correspondence |
55 | 56 |
* analysis. and also the max number of entries and their minimal frequency |
... | ... | |
61 | 62 |
public class CAParametersDialog extends Dialog { |
62 | 63 |
|
63 | 64 |
/** The property. */ |
64 |
private Property property; |
|
65 |
private WordProperty property;
|
|
65 | 66 |
|
66 | 67 |
/** The properties. */ |
67 |
private List<Property> properties; |
|
68 |
private List<WordProperty> properties;
|
|
68 | 69 |
|
69 | 70 |
/** The ana prop combo. */ |
70 | 71 |
private Combo anaPropCombo; |
... | ... | |
107 | 108 |
try { |
108 | 109 |
this.corpus = corpus; |
109 | 110 |
this.title = title; |
110 |
this.properties = new ArrayList<Property>(corpus.getOrderedProperties()); |
|
111 |
this.properties = new ArrayList<WordProperty>(corpus.getOrderedProperties());
|
|
111 | 112 |
} catch (CqiClientException e) { |
112 | 113 |
org.txm.rcp.utils.Logger.printStackTrace(e); |
113 | 114 |
} |
... | ... | |
128 | 129 |
this.title = title; |
129 | 130 |
this.mess = mess; |
130 | 131 |
try { |
131 |
this.properties = new ArrayList<Property>(corpus.getOrderedProperties()); |
|
132 |
this.properties = new ArrayList<WordProperty>(corpus.getOrderedProperties());
|
|
132 | 133 |
} catch (CqiClientException e) { |
133 | 134 |
org.txm.rcp.utils.Logger.printStackTrace(e); |
134 | 135 |
} |
... | ... | |
224 | 225 |
* |
225 | 226 |
* @return the property |
226 | 227 |
*/ |
227 |
public Property getProperty() { |
|
228 |
public WordProperty getProperty() {
|
|
228 | 229 |
return property; |
229 | 230 |
} |
230 | 231 |
|
tmp/org.txm.ca.rcp/src/org/txm/ca/rcp/handlers/ComputeCA.java (revision 1143) | ||
---|---|---|
48 | 48 |
import org.txm.rcp.messages.TXMUIMessages; |
49 | 49 |
import org.txm.searchengine.cqp.corpus.Partition; |
50 | 50 |
import org.txm.searchengine.cqp.corpus.Property; |
51 |
import org.txm.searchengine.cqp.corpus.WordProperty; |
|
51 | 52 |
import org.txm.utils.logger.Log; |
52 | 53 |
import org.txm.utils.logger.MessageBox; |
53 | 54 |
|
... | ... | |
92 | 93 |
CAParametersDialog d = new CAParametersDialog(window.getShell(), partition.getParent(), title); |
93 | 94 |
|
94 | 95 |
if (d.open() == MessageDialog.OK) { |
95 |
Property property = d.getProperty(); |
|
96 |
WordProperty property = d.getProperty();
|
|
96 | 97 |
int fMin = d.getFmin(); |
97 | 98 |
int vMax = d.getMaxLines(); |
98 | 99 |
|
tmp/org.txm.lexicaltable.core/src/org/txm/lexicaltable/core/functions/LexicalTable.java (revision 1143) | ||
---|---|---|
24 | 24 |
import org.txm.searchengine.cqp.corpus.Partition; |
25 | 25 |
import org.txm.searchengine.cqp.corpus.Property; |
26 | 26 |
import org.txm.searchengine.cqp.corpus.Subcorpus; |
27 |
import org.txm.searchengine.cqp.corpus.WordProperty; |
|
27 | 28 |
import org.txm.statsengine.core.StatException; |
28 | 29 |
import org.txm.statsengine.core.data.Vector; |
29 | 30 |
import org.txm.statsengine.r.core.RWorkspace; |
... | ... | |
52 | 53 |
* The property. |
53 | 54 |
*/ |
54 | 55 |
@Parameter(key=TBXPreferences.UNIT_PROPERTY) |
55 |
private Property property; |
|
56 |
private WordProperty property;
|
|
56 | 57 |
|
57 | 58 |
/** |
58 | 59 |
* Minimum frequency. |
... | ... | |
79 | 80 |
* @param analysisProperty |
80 | 81 |
* @param itable |
81 | 82 |
*/ |
82 |
public LexicalTable(CQPCorpus corpus, Property analysisProperty, ILexicalTable itable) { |
|
83 |
public LexicalTable(CQPCorpus corpus, WordProperty analysisProperty, ILexicalTable itable) {
|
|
83 | 84 |
super(corpus); |
84 | 85 |
this.property = analysisProperty; |
85 | 86 |
this.statsData = itable; |
... | ... | |
93 | 94 |
* @param analysisProperty the property to count |
94 | 95 |
* @throws Exception |
95 | 96 |
*/ |
96 |
public LexicalTable(Subcorpus corpus, Property analysisProperty) { |
|
97 |
public LexicalTable(Subcorpus corpus, WordProperty analysisProperty) {
|
|
97 | 98 |
this(corpus, analysisProperty, null); |
98 | 99 |
} |
99 | 100 |
|
... | ... | |
116 | 117 |
* @param vMax |
117 | 118 |
* @param iTable |
118 | 119 |
*/ |
119 |
public LexicalTable(Partition partition, Property analysisProperty, int fMin, int vMax, ILexicalTable iTable) { |
|
120 |
public LexicalTable(Partition partition, WordProperty analysisProperty, int fMin, int vMax, ILexicalTable iTable) {
|
|
120 | 121 |
this(partition, analysisProperty, fMin, vMax, false, iTable); |
121 | 122 |
} |
122 | 123 |
|
... | ... | |
143 | 144 |
* @param fMin |
144 | 145 |
* @param vMax |
145 | 146 |
*/ |
146 |
public LexicalTable(Partition partition, Property analysisProperty, int fMin, int vMax) { |
|
147 |
public LexicalTable(Partition partition, WordProperty analysisProperty, int fMin, int vMax) {
|
|
147 | 148 |
this(partition, analysisProperty, fMin, vMax, null); |
148 | 149 |
} |
149 | 150 |
|
... | ... | |
156 | 157 |
* @param useAllOccurrences |
157 | 158 |
* @param iTable |
158 | 159 |
*/ |
159 |
private LexicalTable(TXMResult parent, Property analysisProperty, int fMin, int vMax, boolean useAllOccurrences, ILexicalTable iTable) { |
|
160 |
private LexicalTable(TXMResult parent, WordProperty analysisProperty, int fMin, int vMax, boolean useAllOccurrences, ILexicalTable iTable) {
|
|
160 | 161 |
super(parent); |
161 | 162 |
this.setParameters(analysisProperty, fMin, vMax, useAllOccurrences); |
162 | 163 |
this.statsData = iTable; |
... | ... | |
526 | 527 |
* |
527 | 528 |
* @return the property. |
528 | 529 |
*/ |
529 |
public Property getProperty() { |
|
530 |
public WordProperty getProperty() {
|
|
530 | 531 |
return property; |
531 | 532 |
} |
532 | 533 |
|
... | ... | |
633 | 634 |
* Sets the unit property. |
634 | 635 |
* @param property |
635 | 636 |
*/ |
636 |
public void setUnitProperty(Property property) { |
|
637 |
public void setUnitProperty(WordProperty property) {
|
|
637 | 638 |
this.property = property; |
638 | 639 |
} |
639 | 640 |
|
640 | 641 |
|
641 |
public void setParameters(Property prop, Integer fmin, Integer vmax, Boolean useAllOccurrences) { |
|
642 |
public void setParameters(WordProperty prop, Integer fmin, Integer vmax, Boolean useAllOccurrences) {
|
|
642 | 643 |
if (prop != null) { |
643 | 644 |
this.property = prop; |
644 | 645 |
} |
tmp/org.txm.ahc.rcp/src/org/txm/ahc/rcp/handlers/ComputeAHC.java (revision 1143) | ||
---|---|---|
48 | 48 |
import org.txm.rcp.handlers.BaseAbstractHandler; |
49 | 49 |
import org.txm.searchengine.cqp.corpus.Partition; |
50 | 50 |
import org.txm.searchengine.cqp.corpus.Property; |
51 |
import org.txm.searchengine.cqp.corpus.WordProperty; |
|
51 | 52 |
import org.txm.statsengine.core.StatException; |
52 | 53 |
import org.txm.utils.logger.Log; |
53 | 54 |
|
... | ... | |
105 | 106 |
d.setFminAndVMax(fMin, vMax); |
106 | 107 |
|
107 | 108 |
if (d.open() == Window.OK) { |
108 |
Property property = d.getProperty(); |
|
109 |
WordProperty property = d.getProperty();
|
|
109 | 110 |
fMin = d.getFmin(); |
110 | 111 |
vMax = d.getMaxLines(); |
111 | 112 |
|
Also available in: Unified diff