Révision 717
tmp/org.txm.progression.rcp/src/org/txm/progression/rcp/editors/ProgressionEditor.java (revision 717) | ||
---|---|---|
235 | 235 |
// Structural units and properties combo viewers |
236 | 236 |
StructuralUnitsCombosGroup structuration = new StructuralUnitsCombosGroup(paramPanel, this, this.getResult().getStructuralUnit(), this.getResult().getStructuralUnitProperty()); |
237 | 237 |
GridData gdata = new GridData(GridData.BEGINNING, GridData.BEGINNING, true, false, 3, 1); |
238 |
structuration.setLayoutData(gdata); |
|
238 |
structuration.setLayoutData(gdata); // the group must use the full line |
|
239 |
|
|
239 | 240 |
// Structural Unit |
240 | 241 |
structuralUnitsComboViewer = structuration.getStructuralUnitsComboViewer(); |
241 | 242 |
|
tmp/org.txm.tigersearch.rcp/plugin.xml (revision 717) | ||
---|---|---|
11 | 11 |
</category> |
12 | 12 |
<command |
13 | 13 |
categoryId="TIGERSearch4TXM.commands.category" |
14 |
defaultHandler="org.txm.tigersearch.commands.ComputeTIGERSearch" |
|
15 | 14 |
id="org.txm.tigersearch.commands.ComputeTIGERSearch" |
16 | 15 |
name="OpenTIGERSearch"> |
17 | 16 |
</command> |
... | ... | |
29 | 28 |
</command> |
30 | 29 |
</extension> |
31 | 30 |
<extension |
31 |
point="org.eclipse.core.expressions.propertyTesters"> |
|
32 |
<propertyTester |
|
33 |
class="org.txm.tigersearch.rcp.tester.TIGERSearchTester" |
|
34 |
id="org.txm.rcp.testers.TIGERSearchTester" |
|
35 |
namespace="org.txm.rcp.testers" |
|
36 |
properties="TIGERSearchReady" |
|
37 |
type="java.lang.Object"> |
|
38 |
</propertyTester> |
|
39 |
</extension> |
|
40 |
<extension |
|
32 | 41 |
point="org.eclipse.ui.menus"> |
33 | 42 |
<menuContribution |
34 | 43 |
locationURI="menu:menu.tools?after=menu.tools.separator.misc"> |
... | ... | |
46 | 55 |
</or> |
47 | 56 |
</visibleWhen> |
48 | 57 |
</command> |
49 |
<command |
|
50 |
commandId="org.txm.tigersearch.commands.ComputeTSIndex" |
|
51 |
icon="icons/functions/TSIndex.png" |
|
52 |
label="TS Index" |
|
53 |
style="push"> |
|
54 |
<visibleWhen |
|
55 |
checkEnabled="false"> |
|
56 |
<or> |
|
57 |
<reference |
|
58 |
definitionId="OneCorpusSelected"> |
|
59 |
</reference> |
|
60 |
<reference |
|
61 |
definitionId="OnePartitionSelected"> |
|
62 |
</reference> |
|
63 |
</or> |
|
64 |
</visibleWhen> |
|
65 |
</command> |
|
66 | 58 |
</menuContribution> |
67 | 59 |
<menuContribution |
68 | 60 |
locationURI="menu:menu.help.plugins"> |
... | ... | |
129 | 121 |
</or> |
130 | 122 |
</visibleWhen> |
131 | 123 |
</command> |
132 |
<command |
|
133 |
commandId="org.txm.tigersearch.commands.ComputeTSIndex" |
|
134 |
icon="icons/functions/TSIndex.png" |
|
135 |
label="TS Index" |
|
136 |
style="push"> |
|
137 |
<visibleWhen |
|
138 |
checkEnabled="false"> |
|
139 |
<or> |
|
140 |
<reference |
|
141 |
definitionId="OneCorpusSelected"> |
|
142 |
</reference> |
|
143 |
<reference |
|
144 |
definitionId="OnePartitionSelected"> |
|
145 |
</reference> |
|
146 |
</or> |
|
147 |
</visibleWhen> |
|
148 |
</command> |
|
149 | 124 |
</menuContribution> |
150 | 125 |
<menuContribution |
151 | 126 |
allPopups="false" |
... | ... | |
164 | 139 |
</or> |
165 | 140 |
</visibleWhen> |
166 | 141 |
</command> |
167 |
<command |
|
168 |
commandId="org.txm.tigersearch.commands.ComputeTSIndex" |
|
169 |
icon="icons/functions/TSIndex.png" |
|
170 |
label="TS Index" |
|
171 |
style="push"> |
|
172 |
<visibleWhen |
|
173 |
checkEnabled="false"> |
|
174 |
<or> |
|
175 |
<reference |
|
176 |
definitionId="OneCorpusSelected"> |
|
177 |
</reference> |
|
178 |
<reference |
|
179 |
definitionId="OnePartitionSelected"> |
|
180 |
</reference> |
|
181 |
</or> |
|
182 |
</visibleWhen> |
|
183 |
</command> |
|
184 | 142 |
</menuContribution> |
185 | 143 |
<menuContribution |
186 |
locationURI="menu:menu.file.import"> |
|
144 |
locationURI="menu:menu.file.import?before=menu.file.import.separator.software">
|
|
187 | 145 |
<command |
188 | 146 |
commandId="org.txm.rcp.handlers.scripts.ExecuteImportScript" |
189 | 147 |
icon="icons/functions/TS.png" |
... | ... | |
221 | 179 |
name="org.txm.tigersearch.commands.DoInstall"> |
222 | 180 |
</PostInstallationStep> |
223 | 181 |
</extension> |
182 |
<extension |
|
183 |
point="org.eclipse.ui.handlers"> |
|
184 |
<handler |
|
185 |
class="org.txm.tigersearch.commands.ComputeTIGERSearch" |
|
186 |
commandId="org.txm.tigersearch.commands.ComputeTIGERSearch"> |
|
187 |
<enabledWhen> |
|
188 |
<test |
|
189 |
forcePluginActivation="true" |
|
190 |
property="org.txm.rcp.testers.TIGERSearchReady" |
|
191 |
value="TIGERSearchReady"> |
|
192 |
</test> |
|
193 |
</enabledWhen> |
|
194 |
</handler> |
|
195 |
</extension> |
|
224 | 196 |
|
225 | 197 |
</plugin> |
tmp/org.txm.tigersearch.rcp/src/org/txm/tigersearch/rcp/tester/TIGERSearchTester.java (revision 717) | ||
---|---|---|
1 |
package org.txm.tigersearch.rcp.tester; |
|
2 |
|
|
3 |
import java.io.File; |
|
4 |
import java.util.List; |
|
5 |
|
|
6 |
import org.eclipse.core.expressions.PropertyTester; |
|
7 |
import org.txm.searchengine.cqp.corpus.MainCorpus; |
|
8 |
|
|
9 |
/** |
|
10 |
* PropertyTester to check if a corpus has TIGERSearch indexes |
|
11 |
* |
|
12 |
* @author mdecorde |
|
13 |
* |
|
14 |
*/ |
|
15 |
public class TIGERSearchTester extends PropertyTester { |
|
16 |
|
|
17 |
public static final String PROPERTY_NAMESPACE = "org.txm.rcp.testers"; //$NON-NLS-1$ |
|
18 |
|
|
19 |
public static final String TIGERSEARCH_READY = "TIGERSearchReady"; //$NON-NLS-1$ |
|
20 |
|
|
21 |
public TIGERSearchTester() { |
|
22 |
// TODO Auto-generated constructor stub |
|
23 |
} |
|
24 |
|
|
25 |
@Override |
|
26 |
public boolean test(Object receiver, String property, Object[] args, |
|
27 |
Object expectedValue) { |
|
28 |
if (receiver instanceof List) { |
|
29 |
receiver = ((List)receiver).get(0); |
|
30 |
if (TIGERSEARCH_READY.equals(property)) { |
|
31 |
if (!(receiver instanceof MainCorpus)) { |
|
32 |
return false; |
|
33 |
} |
|
34 |
MainCorpus corpus = (MainCorpus) receiver; |
|
35 |
|
|
36 |
return new File(corpus.getBaseDirectory(), "tiger").exists(); |
|
37 |
} |
|
38 |
} |
|
39 |
return false; |
|
40 |
} |
|
41 |
} |
|
0 | 42 |
tmp/org.txm.tigersearch.rcp/src/org/txm/importer/tigersearch/TigerXMLSubcorpus.xsd (revision 717) | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8"?> |
|
2 |
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> |
|
3 |
|
|
4 |
<!-- =========================================================================== |
|
5 |
XML Schema for the subcorpus part of the TIGER-XML format |
|
6 |
http://www.ims.uni-stuttgart.de/projekte/TIGER/public/TigerXMLSubcorpus.xsd |
|
7 |
=========================================================================== |
|
8 |
TIGER Project, Wolfgang Lezius |
|
9 |
IMS, University of Stuttgart, 04/01/2003 |
|
10 |
=========================================================================== --> |
|
11 |
|
|
12 |
<!-- ====================================================== |
|
13 |
DECLARATION OF SUBCORPORA AND SENTENCES |
|
14 |
====================================================== --> |
|
15 |
|
|
16 |
|
|
17 |
<!-- declaration of the subcorpus element --> |
|
18 |
|
|
19 |
<xs:element name="subcorpus" type="subcorpusType"/> |
|
20 |
|
|
21 |
|
|
22 |
<!-- declaration of the subcorpus type --> |
|
23 |
|
|
24 |
<xs:complexType name="subcorpusType"> |
|
25 |
|
|
26 |
<!-- A subcorpus may comprise another subcorpora or sentences --> |
|
27 |
|
|
28 |
<xs:choice minOccurs="0" maxOccurs="unbounded"> |
|
29 |
<xs:element name="subcorpus" type="subcorpusType" minOccurs="1" maxOccurs="1"/> |
|
30 |
<xs:element name="s" type="sentenceType" minOccurs="1" maxOccurs="1"/> |
|
31 |
<xs:/choice> |
|
32 |
|
|
33 |
<!-- required: subcorpus name --> |
|
34 |
|
|
35 |
<xs:attribute name="name" type="xsd:string" use="required"/> |
|
36 |
|
|
37 |
<!-- optional: reference to external subcorpus file |
|
38 |
|
|
39 |
A subcorpus of a TigerXML corpus can also be stored in separate file. |
|
40 |
This attribute points to the external subcorpus file. The pointer is |
|
41 |
an URI. Examples: file:relative.xml or file:/path/to/absolute.xml |
|
42 |
|
|
43 |
Note: If there is a pointer to an external file, the subcorpus |
|
44 |
element must be empty. --> |
|
45 |
|
|
46 |
<xs:attribute name="external" type="xsd:anyURI"/> |
|
47 |
|
|
48 |
<xs:/complexType> |
|
49 |
|
|
50 |
|
|
51 |
<!-- declaration of the sentence type --> |
|
52 |
|
|
53 |
<xs:complexType name="sentenceType"> |
|
54 |
|
|
55 |
<xs:sequence> |
|
56 |
<xs:element name="graph" type="graphType" minOccurs="0" maxOccurs="1"/> |
|
57 |
<xs:element name="matches" type="matchesType" minOccurs="0" maxOccurs="1"/> |
|
58 |
<xs:/sequence> |
|
59 |
|
|
60 |
<xs:attribute name="id" type="idType" use="required"/> |
|
61 |
|
|
62 |
<xs:/complexType> |
|
63 |
|
|
64 |
|
|
65 |
<!-- declaration of the graph type --> |
|
66 |
|
|
67 |
<xs:complexType name="graphType"> |
|
68 |
|
|
69 |
<xs:sequence> |
|
70 |
<xs:element name="terminals" type="terminalsType" minOccurs="1" maxOccurs="1"/> |
|
71 |
<xs:element name="nonterminals" type="nonterminalsType" minOccurs="1" maxOccurs="1"/> |
|
72 |
<xs:/sequence> |
|
73 |
|
|
74 |
<xs:attribute name="root" type="idrefType" use="required"/> |
|
75 |
|
|
76 |
<!-- indicated that the exported sentence is discontinuous --> |
|
77 |
<xs:attribute name="discontinuous" type="xsd:boolean" default="false" use="optional"/> |
|
78 |
|
|
79 |
<xs:/complexType> |
|
80 |
|
|
81 |
|
|
82 |
<!-- declaration of the terminals type --> |
|
83 |
|
|
84 |
<xs:complexType name="terminalsType"> |
|
85 |
|
|
86 |
<xs:sequence> |
|
87 |
<xs:element name="t" type="tType" minOccurs="1" maxOccurs="unbounded"/> |
|
88 |
<xs:/sequence> |
|
89 |
|
|
90 |
<xs:/complexType> |
|
91 |
|
|
92 |
|
|
93 |
<!-- declaration of the t element --> |
|
94 |
|
|
95 |
<xs:complexType name="tType"> |
|
96 |
|
|
97 |
<!-- secondary edges possible --> |
|
98 |
<xs:sequence> |
|
99 |
<xs:element name="secedge" type="secedgeType" minOccurs="0" maxOccurs="unbounded"/> |
|
100 |
<xs:/sequence> |
|
101 |
|
|
102 |
<xs:attribute name="id" type="idType" use="required"/> |
|
103 |
<xs:attributeGroup ref="tfeatureAttributes"/> |
|
104 |
|
|
105 |
<xs:/complexType> |
|
106 |
|
|
107 |
|
|
108 |
<!-- declaration of the nonterminals type --> |
|
109 |
|
|
110 |
<xs:complexType name="nonterminalsType"> |
|
111 |
|
|
112 |
<xs:sequence> |
|
113 |
<xs:element name="nt" type="ntType" minOccurs="0" maxOccurs="unbounded"/> |
|
114 |
<xs:/sequence> |
|
115 |
|
|
116 |
<xs:/complexType> |
|
117 |
|
|
118 |
|
|
119 |
<!-- declaration of the nt element --> |
|
120 |
|
|
121 |
<xs:complexType name="ntType"> |
|
122 |
|
|
123 |
<!-- edge and secondary edges possible --> |
|
124 |
<xs:sequence> |
|
125 |
<xs:element name="edge" type="edgeType" minOccurs="0" maxOccurs="unbounded"/> |
|
126 |
<xs:element name="secedge" type="secedgeType" minOccurs="0" maxOccurs="unbounded"/> |
|
127 |
<xs:/sequence> |
|
128 |
|
|
129 |
<xs:attribute name="id" type="idType" use="required"/> |
|
130 |
<xs:attributeGroup ref="ntfeatureAttributes"/> |
|
131 |
|
|
132 |
<xs:/complexType> |
|
133 |
|
|
134 |
|
|
135 |
<!-- declaration of the edge type --> |
|
136 |
|
|
137 |
<xs:complexType name="edgeType"> |
|
138 |
|
|
139 |
<xs:attribute name="idref" type="idrefType" use="required"/> |
|
140 |
|
|
141 |
<xs:attributeGroup ref="edgelabelAttribute"/> |
|
142 |
|
|
143 |
<xs:/complexType> |
|
144 |
|
|
145 |
|
|
146 |
<!-- declaration of the secondary edge type --> |
|
147 |
|
|
148 |
<xs:complexType name="secedgeType"> |
|
149 |
|
|
150 |
<xs:attribute name="idref" type="idrefType" use="required"/> |
|
151 |
|
|
152 |
<xs:attributeGroup ref="secedgelabelAttribute"/> |
|
153 |
|
|
154 |
<xs:/complexType> |
|
155 |
|
|
156 |
|
|
157 |
<!-- declaration of the matches type --> |
|
158 |
|
|
159 |
<xs:complexType name="matchesType"> |
|
160 |
|
|
161 |
<xs:sequence> |
|
162 |
<xs:element name="match" type="matchType" minOccurs="1" maxOccurs="unbounded"/> |
|
163 |
<xs:/sequence> |
|
164 |
|
|
165 |
<xs:/complexType> |
|
166 |
|
|
167 |
|
|
168 |
<!-- declaration of the match type --> |
|
169 |
|
|
170 |
<xs:complexType name="matchType"> |
|
171 |
|
|
172 |
<xs:sequence> |
|
173 |
<xs:element name="variable" type="varType" minOccurs="1" maxOccurs="unbounded"/> |
|
174 |
<xs:/sequence> |
|
175 |
|
|
176 |
<xs:attribute name="subgraph" type="idrefType" use="required"/> |
|
177 |
|
|
178 |
<xs:/complexType> |
|
179 |
|
|
180 |
|
|
181 |
<!-- declaration of the variable type --> |
|
182 |
|
|
183 |
<xs:complexType name="varType"> |
|
184 |
|
|
185 |
<xs:attribute name="name" type="xsd:string" use="required"/> |
|
186 |
|
|
187 |
<xs:attribute name="idref" type="idrefType" use="required"/> |
|
188 |
|
|
189 |
<xs:/complexType> |
|
190 |
|
|
191 |
|
|
192 |
<!-- ====================================================== |
|
193 |
SENTENCE DECLARATIONS THAT SHOULD BE REFINED |
|
194 |
====================================================== --> |
|
195 |
|
|
196 |
<!-- declaration of the TERMINAL FEATURE ATTRIBUTES; |
|
197 |
this group is unrestricted, but should be refined by a |
|
198 |
specialised, corpus-dependent schema --> |
|
199 |
|
|
200 |
<xs:attributeGroup name="tfeatureAttributes"> |
|
201 |
|
|
202 |
<xs:anyAttribute processContents="skip"/> |
|
203 |
|
|
204 |
<xs:/attributeGroup> |
|
205 |
|
|
206 |
|
|
207 |
<!-- declaration of the NONTERMINAL FEATURE ATTRIBUTES; |
|
208 |
this group is unrestricted, but should be refined by a |
|
209 |
specialised, corpus-dependent schema --> |
|
210 |
|
|
211 |
<xs:attributeGroup name="ntfeatureAttributes"> |
|
212 |
|
|
213 |
<xs:anyAttribute processContents="skip"/> |
|
214 |
|
|
215 |
<xs:/attributeGroup> |
|
216 |
|
|
217 |
|
|
218 |
<!-- declaration of the EDGE-LABEL ATTRIBUTE; |
|
219 |
the label attribute is optional which should be refined by a |
|
220 |
specialised, corpus-dependent schema --> |
|
221 |
|
|
222 |
<xs:attributeGroup name="edgelabelAttribute"> |
|
223 |
|
|
224 |
<xs:attribute name="label" type="xsd:string" use="optional"/> |
|
225 |
|
|
226 |
<xs:/attributeGroup> |
|
227 |
|
|
228 |
|
|
229 |
<!-- declaration of the SECONDARY-EDGE-LABEL ATTRIBUTE; |
|
230 |
the label attribute is optional which should be refined by a |
|
231 |
specialised, corpus-dependent schema --> |
|
232 |
|
|
233 |
<xs:attributeGroup name="secedgelabelAttribute"> |
|
234 |
|
|
235 |
<xs:attribute name="label" type="xsd:string" use="optional"/> |
|
236 |
|
|
237 |
<xs:/attributeGroup> |
|
238 |
|
|
239 |
|
|
240 |
<!-- ====================================================== |
|
241 |
ID and IDREF TYPE DECLARATIONS |
|
242 |
====================================================== --> |
|
243 |
|
|
244 |
<!-- Even though XML Schema are a W3C Recommendation, schema |
|
245 |
support of XML parsers is still restricted. Using some |
|
246 |
parsers you might have problems with the ID and IDREF |
|
247 |
attributes in combination with an "anyAttribute" |
|
248 |
declaration. In this case, just modify the base type |
|
249 |
of the following two declarations to "xsd:string". --> |
|
250 |
|
|
251 |
|
|
252 |
<!-- declaration of idType --> |
|
253 |
|
|
254 |
<xs:simpleType name="idType"> |
|
255 |
|
|
256 |
<xs:restriction base="xsd:ID"/> |
|
257 |
|
|
258 |
<xs:/simpleType> |
|
259 |
|
|
260 |
|
|
261 |
<!-- declaration of idrefType --> |
|
262 |
|
|
263 |
<xs:simpleType name="idrefType"> |
|
264 |
|
|
265 |
<xs:restriction base="xsd:IDREF"/> |
|
266 |
|
|
267 |
<xs:/simpleType> |
|
268 |
|
|
269 |
|
|
270 |
<xs:/schema> |
|
0 | 271 |
tmp/org.txm.tigersearch.rcp/src/org/txm/importer/tigersearch/TigerXMLHeader.xsd (revision 717) | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8"?> |
|
2 |
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> |
|
3 |
|
|
4 |
<!-- ======================================================================= |
|
5 |
XML SubSchema for the header part of the TIGER-XML format |
|
6 |
http://www.ims.uni-stuttgart.de/projekte/TIGER/publicTigerXMLHeader.xsd |
|
7 |
======================================================================= |
|
8 |
TIGER Project, Wolfgang Lezius |
|
9 |
IMS, University of Stuttgart, 04/01/2003 |
|
10 |
======================================================================= --> |
|
11 |
|
|
12 |
|
|
13 |
<!-- ====================================================== |
|
14 |
DECLARATION OF THE HEADER |
|
15 |
====================================================== --> |
|
16 |
|
|
17 |
|
|
18 |
<!-- declaration of the head element --> |
|
19 |
|
|
20 |
<xs:element name="head" type="headType"/> |
|
21 |
|
|
22 |
|
|
23 |
<!-- declaration of the header type --> |
|
24 |
|
|
25 |
<xs:complexType name="headType"> |
|
26 |
|
|
27 |
<xs:sequence> |
|
28 |
<xs:element name="meta" type="metaType" minOccurs="0" maxOccurs="1"/> |
|
29 |
<xs:element name="annotation" type="annotationType" minOccurs="0" maxOccurs="1"/> |
|
30 |
<xs:/sequence> |
|
31 |
|
|
32 |
<!-- optional: reference to external header file |
|
33 |
|
|
34 |
The header of a TigerXML corpus can also be stored in separate file. |
|
35 |
This attribute points to the external header file. The pointer is |
|
36 |
an URI. Examples: file:relative.xml or file:/path/to/absolute.xml |
|
37 |
|
|
38 |
Note: If there is a pointer to an external file, the head |
|
39 |
element must be empty. --> |
|
40 |
|
|
41 |
<xs:attribute name="external" type="xsd:anyURI"/> |
|
42 |
|
|
43 |
<xs:/complexType> |
|
44 |
|
|
45 |
|
|
46 |
<!-- declaration of the meta information type --> |
|
47 |
|
|
48 |
<xs:complexType name="metaType"> |
|
49 |
|
|
50 |
<xs:sequence> |
|
51 |
<xs:element name="name" type="xsd:string" minOccurs="0" maxOccurs="1"/> |
|
52 |
<xs:element name="author" type="xsd:string" minOccurs="0" maxOccurs="1"/> |
|
53 |
<xs:element name="date" type="xsd:string" minOccurs="0" maxOccurs="1"/> |
|
54 |
<xs:element name="description" type="xsd:string" minOccurs="0" maxOccurs="1"/> |
|
55 |
<xs:element name="format" type="xsd:string" minOccurs="0" maxOccurs="1"/> |
|
56 |
<xs:element name="history" type="xsd:string" minOccurs="0" maxOccurs="1"/> |
|
57 |
<xs:/sequence> |
|
58 |
|
|
59 |
<xs:/complexType> |
|
60 |
|
|
61 |
|
|
62 |
<!-- declaration of the annotation type --> |
|
63 |
|
|
64 |
<xs:complexType name="annotationType"> |
|
65 |
|
|
66 |
<xs:sequence> |
|
67 |
<xs:element name="feature" type="featureType" minOccurs="1" maxOccurs="unbounded"/> |
|
68 |
<xs:element name="edgelabel" type="edgelabelType" minOccurs="0" maxOccurs="1"/> |
|
69 |
<xs:element name="secedgelabel" type="edgelabelType" minOccurs="0" maxOccurs="1"/> |
|
70 |
<xs:/sequence> |
|
71 |
|
|
72 |
<xs:/complexType> |
|
73 |
|
|
74 |
|
|
75 |
<!-- declaration of the feature type --> |
|
76 |
|
|
77 |
<xs:complexType name="featureType"> |
|
78 |
|
|
79 |
<xs:sequence> |
|
80 |
<xs:element name="value" type="featurevalueType" minOccurs="0" maxOccurs="unbounded"/> |
|
81 |
<xs:/sequence> |
|
82 |
|
|
83 |
<xs:attribute name="name" type="featurenameType" use="required"/> |
|
84 |
|
|
85 |
<xs:attribute name="domain" use="required"> |
|
86 |
<xs:simpleType> |
|
87 |
<xs:restriction base="xsd:string"> |
|
88 |
<xs:enumeration value="T"/> <!-- feature for terminal nodes --> |
|
89 |
<xs:enumeration value="NT"/> <!-- feature for nonterminal nodes --> |
|
90 |
<xs:enumeration value="FREC"/> <!-- feature for both --> |
|
91 |
<xs:/restriction> |
|
92 |
<xs:/simpleType> |
|
93 |
<xs:/attribute> |
|
94 |
|
|
95 |
<xs:/complexType> |
|
96 |
|
|
97 |
|
|
98 |
<!-- declaration of the (secondary) edge label type --> |
|
99 |
|
|
100 |
<xs:complexType name="edgelabelType"> |
|
101 |
|
|
102 |
<xs:sequence> |
|
103 |
<xs:element name="value" type="featurevalueType" minOccurs="0" maxOccurs="unbounded"/> |
|
104 |
<xs:/sequence> |
|
105 |
|
|
106 |
<xs:/complexType> |
|
107 |
|
|
108 |
|
|
109 |
<!-- declaration of the feature value type --> |
|
110 |
|
|
111 |
<xs:complexType name="featurevalueType"> |
|
112 |
|
|
113 |
<xs:simpleContent> <!-- element content: documentation of the feature value --> |
|
114 |
<xs:extension base="xsd:string"> |
|
115 |
<xs:attribute name="name" type="xsd:string"/> |
|
116 |
<xs:/extension> |
|
117 |
<xs:/simpleContent> |
|
118 |
|
|
119 |
|
|
120 |
<xs:/complexType> |
|
121 |
|
|
122 |
|
|
123 |
<!-- ====================================================== |
|
124 |
HEADER DECLARATIONS THAT SHOULD BE REFINED |
|
125 |
====================================================== --> |
|
126 |
|
|
127 |
<!-- declaration of the FEATURE NAMES used in the corpus header; |
|
128 |
this type is unrestricted, but should be refined by a |
|
129 |
specialised, corpus-dependent schema --> |
|
130 |
|
|
131 |
<xs:simpleType name="featurenameType"> |
|
132 |
|
|
133 |
<xs:restriction base="xsd:string"> |
|
134 |
<xs:minLength value="1"/> |
|
135 |
<xs:maxLength value="20"/> |
|
136 |
<xs:whiteSpace value="preserve"/> |
|
137 |
<xs:/restriction> |
|
138 |
|
|
139 |
<xs:/simpleType> |
|
140 |
|
|
141 |
|
|
142 |
<xs:/schema> |
|
0 | 143 |
tmp/org.txm.tigersearch.rcp/src/org/txm/importer/tigersearch/TSImport.groovy (revision 717) | ||
---|---|---|
30 | 30 |
pager = new XTZPager(this) |
31 | 31 |
} |
32 | 32 |
|
33 |
/** |
|
34 |
* Do a XTZ Import then build the TIGERSearch indexes in the binary corpus "tiger" directory |
|
35 |
*/ |
|
33 | 36 |
@Override |
34 | 37 |
public void start() throws InterruptedException { |
35 | 38 |
File tigerSrcDir = sourceDirectory |
39 |
|
|
40 |
def xmlFiles = [] |
|
41 |
sourceDirectory.listFiles(new FileFilter() { |
|
42 |
boolean accept(File file) { |
|
43 |
if (file.isDirectory()) return false; |
|
44 |
if (file.isHidden()) return false; |
|
45 |
if (file.getName().equals("import.xml")) return false; |
|
46 |
if (!file.getName().endsWith(".xml")) return false; |
|
47 |
|
|
48 |
xmlFiles << file |
|
49 |
} |
|
50 |
}); |
|
51 |
|
|
52 |
xmlFiles.remove(new File(sourceDirectory, "import.xml")) |
|
53 |
|
|
54 |
if (xmlFiles.size() == 0) { |
|
55 |
println "Error no XML file found in $sourceDirectory" |
|
56 |
isSuccessful = false; |
|
57 |
return; |
|
58 |
} |
|
59 |
|
|
60 |
File master = xmlFiles[0]; |
|
61 |
println "Main TIGER XML file found: $master" |
|
62 |
|
|
36 | 63 |
File tsXSLFile = new File(Toolbox.getTXMHOMEPATH(), "xsl/ts.xsl"); |
37 | 64 |
BundleUtils.copyFiles("TIGERSearchRCP", "src", "org/txm/importer/tigersearch", "ts.xsl", tsXSLFile.getParentFile()); |
38 | 65 |
|
39 | 66 |
File xmltxmSrcDir = new File(binaryDirectory, "src"); // output directory of the TS XSL transformation |
40 |
|
|
41 |
if (!ApplyXsl2.processImportSources(tsXSLFile, sourceDirectory, xmltxmSrcDir)) { |
|
67 |
xmltxmSrcDir.mkdirs(); |
|
68 |
FileCopy.copy(master, new File(xmltxmSrcDir, master.getName())); |
|
69 |
|
|
70 |
if (!ApplyXsl2.processImportSources(tsXSLFile, xmltxmSrcDir, xmltxmSrcDir)) { |
|
42 | 71 |
println "Error while applying TS XSL file to $tigerSrcDir" |
43 | 72 |
isSuccessful = false; |
44 | 73 |
return; |
... | ... | |
55 | 84 |
File txmDir = new File(binaryDirectory, "txm/"+corpusName); |
56 | 85 |
txmDir.mkdirs(); |
57 | 86 |
FileCopy.copyFiles(sourceDirectory, txmDir) // the compiler step will use these files |
58 |
super.start(); |
|
59 | 87 |
|
88 |
super.start(); // call the usual XTZ import |
|
89 |
|
|
60 | 90 |
if (isSuccessful) { |
61 | 91 |
|
62 | 92 |
File tigerDir = new File(binaryDirectory, "tiger"); |
63 | 93 |
tigerDir.mkdir(); |
64 |
File master = new File(tigerSrcDir, "master.xml"); |
|
65 | 94 |
|
66 |
File logprop = new File(tigerDir, "tigersearch.logprop"); |
|
67 |
|
|
68 |
logprop.withWriter("UTF-8") { writer -> |
|
69 |
writer.write("""# Default log configuration of the TIGERSearch suite |
|
95 |
|
|
96 |
File logprop = new File(tigerDir, "tigersearch.logprop"); |
|
97 |
|
|
98 |
logprop.withWriter("UTF-8") { writer -> |
|
99 |
writer.write("""# Default log configuration of the TIGERSearch suite |
|
70 | 100 |
log4j.rootLogger=WARN,Logfile |
71 |
log4j.logger.ims.tiger.gui.tigersearch.TIGERSearch=INFO
|
|
101 |
log4j.logger.ims.tiger.gui.tigersearch.TIGERSearch=WARNING
|
|
72 | 102 |
log4j.appender.Logfile=org.apache.log4j.RollingFileAppender |
73 | 103 |
log4j.appender.Logfile.File=\${user.home}/tigersearch/tigersearch.log |
74 | 104 |
log4j.appender.Logfile.MaxFileSize=500KB |
75 | 105 |
log4j.appender.Logfile.MaxBackupIndex=1 |
76 | 106 |
log4j.appender.Logfile.layout=org.apache.log4j.PatternLayout |
77 | 107 |
log4j.appender.Logfile.layout.ConversionPattern=%5r %-5p [%t] %c{2} - %m%n""") |
108 |
} |
|
109 |
|
|
110 |
BasicConfigurator.configure(); |
|
111 |
String uri = master.getAbsolutePath(); |
|
112 |
File tigerBinDir = new File(tigerDir, corpusName) |
|
113 |
tigerBinDir.mkdir() |
|
114 |
try { |
|
115 |
IndexBuilderErrorHandler handler = new SimpleErrorHandler(tigerBinDir.getAbsolutePath()); |
|
116 |
XMLIndexing indexing = new XMLIndexing(corpusName, uri, tigerBinDir.getAbsolutePath(), handler,false); |
|
117 |
indexing.startIndexing(); |
|
118 |
} |
|
119 |
catch (Exception e) { System.out.println(e.getMessage()); } |
|
78 | 120 |
} |
79 |
|
|
80 |
BasicConfigurator.configure(); |
|
81 |
String uri = master.getAbsolutePath(); |
|
82 |
File tigerBinDir = new File(tigerDir, corpusName) |
|
83 |
tigerBinDir.mkdir() |
|
84 |
try { |
|
85 |
IndexBuilderErrorHandler handler = new SimpleErrorHandler(tigerBinDir.getAbsolutePath()); |
|
86 |
XMLIndexing indexing = new XMLIndexing(corpusName, uri, tigerBinDir.getAbsolutePath(), handler,false); |
|
87 |
indexing.startIndexing(); |
|
88 |
} |
|
89 |
catch (Exception e) { System.out.println(e.getMessage()); } |
|
90 |
} |
|
91 | 121 |
} |
92 | 122 |
} |
tmp/org.txm.tigersearch.rcp/src/org/txm/importer/tigersearch/TigerXML.xsd (revision 717) | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8"?> |
|
2 |
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> |
|
3 |
|
|
4 |
<!-- ================================================================== |
|
5 |
XML Schema for the TIGER-XML format |
|
6 |
http://www.ims.uni-stuttgart.de/projekte/TIGER/public/TigerXML.xsd |
|
7 |
================================================================== |
|
8 |
TIGER Project, Wolfgang Lezius |
|
9 |
IMS, University of Stuttgart, 04/01/2003 |
|
10 |
================================================================== --> |
|
11 |
|
|
12 |
|
|
13 |
<!-- ====================================================== |
|
14 |
INCLUDES DECLARATION OF THE HEADER |
|
15 |
====================================================== --> |
|
16 |
<xs:include schemaLocation="TigerXMLHeader.xsd"/> |
|
17 |
|
|
18 |
|
|
19 |
<!-- ====================================================== |
|
20 |
INCLUDES DECLARATION OF SUBCORPORA AND SENTENCES |
|
21 |
====================================================== --> |
|
22 |
<xs:include schemaLocation="TigerXMLSubcorpus.xsd"/> |
|
23 |
|
|
24 |
|
|
25 |
<!-- ====================================================== |
|
26 |
DECLARATION OF THE CORPUS DOCUMENT |
|
27 |
====================================================== --> |
|
28 |
|
|
29 |
<!-- declaration of the root element: corpus --> |
|
30 |
|
|
31 |
<xs:element name="corpus"> |
|
32 |
|
|
33 |
|
|
34 |
|
|
35 |
<xs:complexType> |
|
36 |
|
|
37 |
<xs:sequence> |
|
38 |
|
|
39 |
<xs:choice> |
|
40 |
<!-- header of the document is optional --> |
|
41 |
<xs:element name="head" type="headType" minOccurs="0" maxOccurs="1" /> |
|
42 |
<xs:/choice> |
|
43 |
|
|
44 |
<xs:element name="body" type="bodyType" minOccurs="1" maxOccurs="1" /> |
|
45 |
|
|
46 |
<xs:/sequence> |
|
47 |
|
|
48 |
<!-- corpus ID --> |
|
49 |
<xs:attribute name="id" type="idType" use="required" /> |
|
50 |
|
|
51 |
<!-- optional attribute: TigerXML version; used by TIGERSearch only --> |
|
52 |
<xs:attribute name="version" type="xsd:string" use="optional" /> |
|
53 |
|
|
54 |
<xs:/complexType> |
|
55 |
<xs:/element> |
|
56 |
|
|
57 |
|
|
58 |
<!-- declaration of the body type --> |
|
59 |
|
|
60 |
<xs:complexType name="bodyType"> |
|
61 |
|
|
62 |
<xs:choice minOccurs="1" maxOccurs="unbounded"> |
|
63 |
<xs:element name="subcorpus" type="subcorpusType" minOccurs="1" maxOccurs="1"/> |
|
64 |
<xs:element name="s" type="sentenceType" minOccurs="1" maxOccurs="1"/> |
|
65 |
<xs:/choice> |
|
66 |
|
|
67 |
<xs:/complexType> |
|
68 |
|
|
69 |
|
|
70 |
<xs:/schema> |
|
0 | 71 |
tmp/org.txm.tigersearch.rcp/src/org/txm/function/tigersearch/TIGERSearch.java (revision 717) | ||
---|---|---|
196 | 196 |
} |
197 | 197 |
|
198 | 198 |
public String toString() { |
199 |
return query.substring(0, Math.min(20, query.length())).replaceAll("\n", " ")+" T: "+T+" NT: "+NT; |
|
199 |
if (query != null) |
|
200 |
return query.substring(0, Math.min(20, query.length())).replaceAll("\n", " ")+" T: "+T+" NT: "+NT; |
|
201 |
|
|
202 |
return ""+corpus; |
|
200 | 203 |
} |
201 | 204 |
|
202 | 205 |
public boolean openEditor() { |
tmp/org.txm.searchengine.cqp.core/src/org/txm/importer/cwb/CwbEncode.java (revision 717) | ||
---|---|---|
86 | 86 |
*/ |
87 | 87 |
public boolean run(String pathToData, |
88 | 88 |
String inputFile, String pathToRegistry, String[] pAttributes, |
89 |
String[] sAttributes) throws ServerNotFoundException, InterruptedException, IOException { |
|
90 |
return run(pathToData, inputFile, |
|
91 |
pathToRegistry, pAttributes, sAttributes, false); |
|
92 |
} |
|
93 |
|
|
94 |
/** |
|
95 |
* Instantiates a new CQi server using executable path set in CQPLibPreferences. |
|
96 |
* |
|
97 |
* @param pathToData the path to data |
|
98 |
* @param inputFiles the input files |
|
99 |
* @param pathToRegistry the path to the registry |
|
100 |
* @param pAttributes the positional attribute |
|
101 |
* @param sAttributes the structural attribute |
|
102 |
* @return true if successful |
|
103 |
* @throws ServerNotFoundException the server not found exception |
|
104 |
* @throws IOException |
|
105 |
* @throws InterruptedException |
|
106 |
*/ |
|
107 |
public boolean run(String pathToData, |
|
108 |
String inputFile, String pathToRegistry, String[] pAttributes, |
|
89 | 109 |
String[] sAttributes, boolean monitorOutput) throws ServerNotFoundException, InterruptedException, IOException { |
90 | 110 |
|
91 | 111 |
File pathToExecutable = new File(TXMPreferences.getString(CQPLibPreferences.CQI_SERVER_PATH_TO_CQPLIB, CQPLibPreferences.PREFERENCES_NODE), |
tmp/org.txm.searchengine.cqp.core/src/org/txm/importer/cwb/CwbMakeAll.java (revision 717) | ||
---|---|---|
87 | 87 |
* @throws InterruptedException |
88 | 88 |
*/ |
89 | 89 |
public boolean run(String corpusName, |
90 |
String pathToRegistry) throws ServerNotFoundException, InterruptedException, IOException { |
|
91 |
return run(corpusName, pathToRegistry, false); |
|
92 |
} |
|
93 |
|
|
94 |
/** |
|
95 |
* * Instantiates a new Cwb Make All using executable file set in preferences |
|
96 |
* |
|
97 |
* @param corpusName the corpus name |
|
98 |
* @param pathToRegistry the path to the registry |
|
99 |
* @return true, if successful |
|
100 |
* @throws ServerNotFoundException the server not found exception |
|
101 |
* @throws IOException |
|
102 |
* @throws InterruptedException |
|
103 |
*/ |
|
104 |
public boolean run(String corpusName, |
|
90 | 105 |
String pathToRegistry, boolean monitorOutput) throws ServerNotFoundException, InterruptedException, IOException { |
91 | 106 |
|
92 | 107 |
File pathToExecutable = new File(TXMPreferences.getString(CQPLibPreferences.CQI_SERVER_PATH_TO_CQPLIB, CQPLibPreferences.PREFERENCES_NODE), |
Formats disponibles : Unified diff