70 |
70 |
Partition partition;
|
71 |
71 |
|
72 |
72 |
/** The maxvalue. */
|
73 |
|
int maxvalue = 20;
|
|
73 |
int pMaxValue = 20;
|
74 |
74 |
|
75 |
75 |
// Numbers
|
76 |
76 |
/** The T. */
|
... | ... | |
121 |
121 |
* Instantiates a new diagnostic.
|
122 |
122 |
*
|
123 |
123 |
* @param corpus a MainCorpus or a SubCorpus
|
124 |
|
* @param maxvalue the number of values of properties shown
|
|
124 |
* @param pMaxValue the number of values of properties shown
|
125 |
125 |
*/
|
126 |
126 |
public Diagnostic(Corpus corpus) {
|
127 |
127 |
super(corpus);
|
128 |
128 |
this.corpus = corpus;
|
129 |
|
if (maxvalue <= 0)
|
130 |
|
maxvalue = 10;
|
131 |
|
|
132 |
129 |
}
|
133 |
130 |
|
134 |
131 |
public void setParameters(int maxvalue) {
|
135 |
|
this.maxvalue = maxvalue;
|
|
132 |
this.pMaxValue = maxvalue;
|
|
133 |
if (pMaxValue <= 0)
|
|
134 |
pMaxValue = 10;
|
136 |
135 |
}
|
137 |
136 |
|
138 |
137 |
@Override
|
... | ... | |
160 |
159 |
+ TXMCoreMessages.Diagnostic_4);
|
161 |
160 |
return;
|
162 |
161 |
}
|
|
162 |
|
163 |
163 |
try {
|
164 |
164 |
T = corpus.getSize();// corpus.getLexicon(corpus.getProperty("id")).nbrOfToken();
|
165 |
165 |
} catch (CqiClientException e1) {
|
... | ... | |
183 |
183 |
//propertiesCounts.put(p.getName(), size);
|
184 |
184 |
//List<String> list = Arrays.asList(corpus.getLexicon(p).getForms(this.maxvalue));
|
185 |
185 |
|
186 |
|
int[] positions = new int[Math.min(maxvalue, T)];
|
187 |
|
for(int i = 0 ; i < Math.min(maxvalue, T) ; i++)
|
|
186 |
int[] positions = new int[Math.min(pMaxValue, T)];
|
|
187 |
for(int i = 0 ; i < Math.min(pMaxValue, T) ; i++)
|
188 |
188 |
positions[i] = i;
|
189 |
189 |
|
190 |
190 |
//ArrayList<String> values = new ArrayList<String>();
|
... | ... | |
223 |
223 |
internalArchitectureProperties.get(su.getName()).put(
|
224 |
224 |
sup.getName(),
|
225 |
225 |
allvalues.subList(0, Math.min(allvalues.size(),
|
226 |
|
maxvalue)));
|
|
226 |
pMaxValue)));
|
227 |
227 |
internalArchitecturePropertiesCounts.get(su.getName())
|
228 |
228 |
.put(sup.getName(), allvalues.size());
|
229 |
229 |
} catch (Exception e) {
|
... | ... | |
295 |
295 |
buff.append("</ul>\n"); //$NON-NLS-1$
|
296 |
296 |
|
297 |
297 |
// Propriétés d'occurrences
|
298 |
|
buff.append("<h3 style'font-family:\"Arial\";'>"+NLS.bind(TXMCoreMessages.Diagnostic_14, maxvalue) + "</h3>\n"); //$NON-NLS-1$ //$NON-NLS-2$
|
|
298 |
buff.append("<h3 style'font-family:\"Arial\";'>"+NLS.bind(TXMCoreMessages.Diagnostic_14, pMaxValue) + "</h3>\n"); //$NON-NLS-1$ //$NON-NLS-2$
|
299 |
299 |
ArrayList<String> properties = new ArrayList<String>(propertiesValues.keySet());
|
300 |
300 |
Collections.sort(properties);
|
301 |
301 |
buff.append("<ul>\n"); //$NON-NLS-1$
|
... | ... | |
313 |
313 |
buff.append("</ul>\n"); //$NON-NLS-1$
|
314 |
314 |
|
315 |
315 |
// Propriété de structures
|
316 |
|
buff.append("<h3 style'font-family:\"Arial\";'>"+NLS.bind(TXMCoreMessages.Diagnostic_22, maxvalue)+"</h3>\n"); //$NON-NLS-1$ //$NON-NLS-2$
|
|
316 |
buff.append("<h3 style'font-family:\"Arial\";'>"+NLS.bind(TXMCoreMessages.Diagnostic_22, pMaxValue)+"</h3>\n"); //$NON-NLS-1$ //$NON-NLS-2$
|
317 |
317 |
buff.append("<ul>\n"); //$NON-NLS-1$
|
318 |
318 |
for (String s : internalArchitecture) {
|
319 |
319 |
StringBuffer subbuffer = new StringBuffer();
|
... | ... | |
354 |
354 |
else
|
355 |
355 |
subbuffer.append(", "); //$NON-NLS-1$
|
356 |
356 |
|
357 |
|
if (i >= maxvalue) {
|
|
357 |
if (i >= pMaxValue) {
|
358 |
358 |
subbuffer.append("..."); //$NON-NLS-1$
|
359 |
359 |
break;
|
360 |
360 |
}
|