Révision 3847

TXM/trunk/bundles/org.txm.properties.core/src/org/txm/properties/core/messages/PropertiesCoreMessages.java (revision 3847)
33 33
	public static String noProperty;
34 34
	
35 35
	public static String descriptionOf;
36

  
37
	public static String details;
36 38
	
37 39
	public static String generalStatistics;
38 40
	
......
55 57
	public static String updatedTheP0;
56 58
	
57 59
	public static String createdTheP0;
60

  
61
	public static String LexicalUnitsProperties;
62

  
63
	public static String Parts;
58 64
	
59 65
	
60 66
	
67
	public static String StructuralUnitsProperties;
68

  
69
	public static String SummaryStatistics;
70

  
71

  
72

  
61 73
	static {
62 74
		// initialize resource bundle
63 75
		Utf8NLS.initializeMessages(BUNDLE_NAME, PropertiesCoreMessages.class);
TXM/trunk/bundles/org.txm.properties.core/src/org/txm/properties/core/messages/messages.properties (revision 3847)
2 2
#Fri Jun 10 16:36:03 CEST 2022
3 3
createdTheP0=<p>Creation date\: {0}</p>
4 4
descriptionOf=Properties of 
5
details=D?tails
5 6
error=** Error
6 7
error_failedToAccessLexiconOfCorpusP0=** Failed to access the {0} corpus lexicon.
7 8
error_failedToAccessPropertieOfCorpusP0=** Failed to access the properties of the {0} corpus.
8 9
error_failedToAccessStructuresOfCorpusP0=** Failed to access structures of the {0} corpus.
9 10
generalStatistics=* General Statistics 
10 11
generalStatistics_2=Summary Statistics
12
LexicalUnitsProperties=Lexical Units properties
11 13
lexicalUnitsPropertiesMaxP0Values=Lexical Units properties (max {0} values)
12 14
noProperty=No property
13 15
numberOfStructuralUnits=Number of structural units\: {0}&nbsp;&nbsp;({1})
14 16
numberOfWordProperties=Number of word properties\: {0}&nbsp;&nbsp;({1})
15 17
numberOfWordsP0=Number of words\: {0}
18
Parts=Parts
16 19
RESULT_TYPE=Properties
17 20
s=- S 
18 21
structuralUnitsProperties=<h3>Structures properties 
22
StructuralUnitsProperties=Structural Units properties
23
SummaryStatistics=Summary Statistics
19 24
structuralUnitsPropertiesMaxP0Values=Structural Units properties (max {0} values)
20 25
t=- T 
21 26
updatedTheP0=<p>Last update\: {0}</p>
TXM/trunk/bundles/org.txm.properties.core/src/org/txm/properties/core/functions/PartitionPropertiesComputer.java (revision 3847)
5 5
import java.util.LinkedHashSet;
6 6
import java.util.List;
7 7

  
8
import org.txm.properties.core.messages.PropertiesCoreMessages;
8 9
import org.txm.searchengine.cqp.clientExceptions.CqiClientException;
9 10
import org.txm.searchengine.cqp.corpus.Part;
10 11
import org.txm.searchengine.cqp.corpus.Partition;
......
18 19
	
19 20
	@Override
20 21
	public LinkedHashSet<String> getComputableInformations() {
21
		return new LinkedHashSet(Arrays.asList("all"));
22
		return new LinkedHashSet(Arrays.asList(PropertiesCoreMessages.Parts));
22 23
	}
23 24
	
24 25
	@Override
25 26
	public String getInformation(String name) {
26 27
		LinkedHashMap<String, String> data = new LinkedHashMap<>();
27
		data.put("all", dump());
28
		data.put(PropertiesCoreMessages.Parts, dump());
28 29
		return data.get(name);
29 30
	}
30 31
	
......
48 49
		StringBuffer buff = new StringBuffer();
49 50
		
50 51
		List<Part> parts = result.getParts();
51
		buff.append(""+parts.size()+" parts:");
52
		buff.append(""+parts.size()+PropertiesCoreMessages.Parts); //$NON-NLS-1$
52 53
		int n = 0;
53 54
		for (Part p : parts) {
54 55
			
55 56
			if (n >= props.pMaxPropertiesToDisplay) {
56
				buff.append("\n\t...");
57
				buff.append("\n\t..."); //$NON-NLS-1$
57 58
				break;
58 59
			}
59 60
			
60 61
			try {
61
				buff.append("\n\t"+p.getName()+": "+p.getSize());
62
				buff.append("\n\t"+p.getName()+": "+p.getSize()); //$NON-NLS-1$ //$NON-NLS-2$
62 63
			} catch (CqiClientException e) {
63 64
				// TODO Auto-generated catch block
64 65
				e.printStackTrace();
......
71 72
	public String htmlDump() {
72 73
		StringBuffer buff = new StringBuffer();
73 74
		List<Part> parts = result.getParts();
74
		buff.append("<h3>"+parts.size()+" parts:"+"</h3>");
75
		buff.append("<ul>");
75
		buff.append("<h3>"+parts.size()+PropertiesCoreMessages.Parts+"</h3>"); //$NON-NLS-1$ //$NON-NLS-3$
76
		buff.append("<ul>"); //$NON-NLS-1$
76 77
		int n = 0;
77 78
		for (Part p : parts) {
78 79
			
79 80
			if (n >= props.pMaxPropertiesToDisplay) {
80
				buff.append("<li>...</li>");
81
				buff.append("<li>...</li>"); //$NON-NLS-1$
81 82
				break;
82 83
			}
83 84
			
84 85
			try {
85
				buff.append("<li>"+p.getName()+" ("+p.getSize()+")</li>");
86
				buff.append("<li>"+p.getName()+" ("+p.getSize()+")</li>"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
86 87
			} catch (CqiClientException e) {
87 88
				// TODO Auto-generated catch block
88 89
				e.printStackTrace();
89 90
			}
90 91
			n++;
91 92
		}
92
		buff.append("</ul>");
93
		buff.append("</ul>"); //$NON-NLS-1$
93 94
		
94 95
		return buff.toString();
95 96
	}
TXM/trunk/bundles/org.txm.properties.core/src/org/txm/properties/core/functions/CorpusPropertiesComputer.java (revision 3847)
36 36

  
37 37
public class CorpusPropertiesComputer extends PropertiesComputer<CQPCorpus> {
38 38

  
39
	LinkedHashSet<String> computableInformations = new LinkedHashSet<String>(Arrays.asList("Summary Statistics", "Lexical Units properties", "Structural Units properties"));
39
	LinkedHashSet<String> computableInformations = new LinkedHashSet<String>(Arrays.asList(PropertiesCoreMessages.SummaryStatistics, PropertiesCoreMessages.LexicalUnitsProperties, PropertiesCoreMessages.StructuralUnitsProperties));
40 40
	//new ArrayList<String>(Arrays.asList("Statistiques Générales", "Propriétés des unités lexicales", "Propriétés des structures"));
41 41
	// Summary Statistics, Lexical Units properties, Structural Units properties
42 42

  
......
54 54
	@Override
55 55
	public String getInformation(String name) {
56 56

  
57
		if ("Summary Statistics".equals(name)) {
57
		if (PropertiesCoreMessages.SummaryStatistics.equals(name)) {
58 58
			return dumpGeneralStats();
59
		} else if ("Lexical Units properties".equals(name)) {
59
		} else if (PropertiesCoreMessages.LexicalUnitsProperties.equals(name)) {
60 60
			return dumpLexicalStats();
61
		} else if ("Structural Units properties".equals(name)) {
61
		} else if (PropertiesCoreMessages.StructuralUnitsProperties.equals(name)) {
62 62
			return dumpStrutureStats();
63 63
		} else {
64 64
			return data.get(name);
......
68 68
	@Override
69 69
	public String getInformationHTML(String name) {
70 70

  
71
		if ("Summary Statistics".equals(name)) {
71
		if (PropertiesCoreMessages.SummaryStatistics.equals(name)) {
72 72
			return htmlDumpGeneralStats(null);
73
		} else if ("Lexical Units properties".equals(name)) {
73
		} else if (PropertiesCoreMessages.LexicalUnitsProperties.equals(name)) {
74 74
			return htmlDumpLexicalProperties(null);
75
		} else if ("Structural Units properties".equals(name)) {
75
		} else if (PropertiesCoreMessages.StructuralUnitsProperties.equals(name)) {
76 76
			return htmlDumpStructureProperties(null);
77 77
		} else {
78 78
			return getInformation(name);
......
141 141

  
142 142
			List<WordProperty> pproperties = new ArrayList<>(properties);
143 143
			for (WordProperty p : properties) {
144
				if (p.getName().equals("id")) {
144
				if (p.getName().equals("id")) { //$NON-NLS-1$
145 145
					pproperties.remove(p);
146 146
				}
147 147
			}
......
206 206

  
207 207
			List<StructuralUnit> sstructures = new ArrayList<>(structures);
208 208
			for (StructuralUnit su : structures) {
209
				if (su.getName().equals("txmcorpus")) {
209
				if (su.getName().equals("txmcorpus")) { //$NON-NLS-1$
210 210
					sstructures.remove(su);
211 211
				}
212 212
			}
......
243 243
		HashMap<String, org.txm.utils.Tuple<Integer>> firstPositionOfStructures = new HashMap<>();
244 244
		for (String su : internalArchitecture) {
245 245
			try {
246
				QueryResult r = result.query(new CQLQuery("<"+su+">[]+ </"+su+"> cut 1"), "tmp", false);
246
				QueryResult r = result.query(new CQLQuery("<"+su+">[]+ </"+su+"> cut 1"), "tmp", false); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
247 247
				if (r.getNMatch() > 0) {
248 248
					firstPositionOfStructures.put(su, new org.txm.utils.Tuple<Integer>(r.getStarts()[0], r.getEnds()[0]));
249 249
				} else {
......
282 282
		buff.append("<ul>\n"); //$NON-NLS-1$
283 283
		buff.append("<li>" + NLS.bind(PropertiesCoreMessages.numberOfWordsP0, NumberFormat.getInstance().format(numberOfWords)) + "</li>\n"); //$NON-NLS-1$ //$NON-NLS-2$
284 284

  
285
		buff.append("<li>" + NLS.bind(PropertiesCoreMessages.numberOfWordProperties, properties.size(), StringUtils.join(properties, ", ")) + "</li>\n"); //$NON-NLS-2$ //$NON-NLS-1$
286
		buff.append("<li>" + NLS.bind(PropertiesCoreMessages.numberOfStructuralUnits, structures.size(), StringUtils.join(structures, ", ")) + "</li>\n"); //$NON-NLS-2$ //$NON-NLS-1$
285
		buff.append("<li>" + NLS.bind(PropertiesCoreMessages.numberOfWordProperties, properties.size(), StringUtils.join(properties, ", ")) + "</li>\n"); //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-1$
286
		buff.append("<li>" + NLS.bind(PropertiesCoreMessages.numberOfStructuralUnits, structures.size(), StringUtils.join(structures, ", ")) + "</li>\n"); //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-1$
287 287
		buff.append("</ul>\n"); //$NON-NLS-1$
288 288

  
289 289
		return buff.toString();
......
424 424

  
425 425
		StringBuffer buff = new StringBuffer();
426 426

  
427
		buff.append(PropertiesCoreMessages.t + String.format(Locale.FRANCE, "%,d", numberOfWords) + "\n"); //$NON-NLS-1$
428
		buff.append(PropertiesCoreMessages.wordProperties + String.format("%,d", NProperties) + "\n"); //$NON-NLS-1$
427
		buff.append(PropertiesCoreMessages.t + String.format(Locale.FRANCE, "%,d", numberOfWords) + "\n"); //$NON-NLS-1$ //$NON-NLS-2$
428
		buff.append(PropertiesCoreMessages.wordProperties + String.format("%,d", NProperties) + "\n"); //$NON-NLS-1$ //$NON-NLS-2$
429 429

  
430
		buff.append(PropertiesCoreMessages.s + String.format("%,d", NStructures) + "\n"); //$NON-NLS-1$
430
		buff.append(PropertiesCoreMessages.s + String.format("%,d", NStructures) + "\n"); //$NON-NLS-1$ //$NON-NLS-2$
431 431
		for (String s : structuresCounts.keySet()) {
432 432
			buff.append(" - " + s + "\n");// +structuresCounts.get(s)+"\n"); //$NON-NLS-1$ //$NON-NLS-2$
433 433
		}
......
572 572
		this.stepStructuralUnits();
573 573
		monitor.worked(33);
574 574

  
575
		computableInformations = new LinkedHashSet<String>(Arrays.asList("Summary Statistics", "Lexical Units properties", "Structural Units properties"));
575
		computableInformations = new LinkedHashSet<String>(Arrays.asList(PropertiesCoreMessages.SummaryStatistics, PropertiesCoreMessages.LexicalUnitsProperties, PropertiesCoreMessages.StructuralUnitsProperties));
576 576
		data.clear();
577 577

  
578 578
		for (EngineType set : Toolbox.getEngineManagers().keySet()) {
......
583 583
				String info = engine.hasAdditionalDetailsForResult(result);
584 584
				if (info != null && info.length() > 0) {
585 585
					if (!data.containsKey(info)) {
586
						data.put(info, "");
586
						data.put(info, ""); //$NON-NLS-1$
587 587
					}
588
					data.put(info, data.get(info) + "\n" + engine.getAdditionalDetailsForResult(result));
588
					data.put(info, data.get(info) + "\n" + engine.getAdditionalDetailsForResult(result)); //$NON-NLS-1$
589 589
					computableInformations.add(info);
590 590
				}
591 591
			}
......
599 599
			return NLS.bind(PropertiesCoreMessages.numberOfWordsP0, numberOfWords);
600 600
		}
601 601
		else {
602
			return "";
602
			return ""; //$NON-NLS-1$
603 603
		}
604 604
	}
605 605
}
TXM/trunk/bundles/org.txm.properties.core/src/org/txm/properties/core/functions/PropertiesComputer.java (revision 3847)
54 54
	public abstract boolean _compute(TXMProgressMonitor monitor) throws Exception;
55 55
	
56 56
	public String getName() {
57
		return result.getClass().getSimpleName() + "-" + result.getName();
57
		return result.getClass().getSimpleName() + "-" + result.getName(); //$NON-NLS-1$
58 58
	}
59 59
}
TXM/trunk/bundles/org.txm.properties.core/src/org/txm/properties/core/functions/Properties.java (revision 3847)
100 100
				
101 101
				@Override
102 102
				public LinkedHashSet<String> getComputableInformations() {
103
					return new LinkedHashSet<String>(Arrays.asList("details"));
103
					return new LinkedHashSet<String>(Arrays.asList(PropertiesCoreMessages.details));
104 104
				}
105 105
				
106 106
				@Override
......
179 179
		buffer.append("<h1 style'font-family:\"Arial\";'>" + PropertiesCoreMessages.descriptionOf + this.getParent().getName() + "</h1>\n"); //$NON-NLS-2$ //$NON-NLS-1$
180 180
		
181 181
		for (String info : computer.getComputableInformations()) {
182
			buffer.append("<div id=\""+info+"\">\n");
183
			buffer.append("<h2>"+info+"</h2>\n");
182
			buffer.append("<div id=\""+info+"\">\n"); //$NON-NLS-1$ //$NON-NLS-2$
183
			buffer.append("<h2>"+info+"</h2>\n"); //$NON-NLS-1$ //$NON-NLS-2$
184 184
			buffer.append(computer.getInformationHTML(info));
185
			buffer.append("</div>\n");
185
			buffer.append("</div>\n"); //$NON-NLS-1$
186 186
		}
187 187
		
188 188
		buffer.append("</body>\n"); //$NON-NLS-1$
......
192 192
	public String dump(int maxvalue) {
193 193
		StringBuffer buffer = new StringBuffer();
194 194
		for (String info : computer.getComputableInformations()) {
195
			buffer.append(info+"\n");
195
			buffer.append(info+"\n"); //$NON-NLS-1$
196 196
			buffer.append(computer.getInformation(info).toString());
197
			buffer.append(info+"\n");
197
			buffer.append(info+"\n"); //$NON-NLS-1$
198 198
		}
199 199
		return buffer.toString();
200 200
	}

Formats disponibles : Unified diff