@@ -38,6 +38,7 @@ public enum Format {
38
38
final Integer tagColumn ;
39
39
final TreeReaderFactory trf ;
40
40
final boolean usesComments ;
41
+ final boolean skipMWT ;
41
42
42
43
private TaggedFileRecord (String file , Format format ,
43
44
String encoding , String tagSeparator ,
@@ -47,7 +48,7 @@ private TaggedFileRecord(String file, Format format,
47
48
NumberRangesFileFilter treeRange ,
48
49
Predicate <Tree > treeFilter ,
49
50
Integer wordColumn , Integer tagColumn ,
50
- boolean usesComments ) {
51
+ boolean usesComments , boolean skipMWT ) {
51
52
this .file = file ;
52
53
this .format = format ;
53
54
this .encoding = encoding ;
@@ -60,6 +61,7 @@ private TaggedFileRecord(String file, Format format,
60
61
this .tagColumn = tagColumn ;
61
62
this .trf = trf ;
62
63
this .usesComments = usesComments ;
64
+ this .skipMWT = skipMWT ;
63
65
}
64
66
65
67
public static final String FORMAT = "format" ;
@@ -73,6 +75,7 @@ private TaggedFileRecord(String file, Format format,
73
75
public static final String TAG_COLUMN = "tagColumn" ;
74
76
public static final String TREE_READER = "trf" ;
75
77
public static final String COMMENTS = "comments" ;
78
+ public static final String SKIP_MWT = "skipMWT" ;
76
79
77
80
public String toString () {
78
81
StringBuilder s = new StringBuilder ();
@@ -107,6 +110,9 @@ public String toString() {
107
110
if (usesComments ) {
108
111
s .append ("," + COMMENTS + "=true" );
109
112
}
113
+ if (skipMWT ) {
114
+ s .append ("," + SKIP_MWT + "=true" );
115
+ }
110
116
return s .toString ();
111
117
}
112
118
@@ -142,7 +148,7 @@ public static TaggedFileRecord createRecord(Properties config,
142
148
return new TaggedFileRecord (description , Format .TEXT ,
143
149
getEncoding (config ),
144
150
getTagSeparator (config ),
145
- null , null , null , null , null , null , null , false );
151
+ null , null , null , null , null , null , null , false , false );
146
152
}
147
153
148
154
String [] args = new String [pieces .length - 1 ];
@@ -158,6 +164,7 @@ public static TaggedFileRecord createRecord(Properties config,
158
164
Predicate <Tree > treeFilter = null ;
159
165
Integer wordColumn = null , tagColumn = null ;
160
166
boolean comments = false ;
167
+ boolean skipMWT = false ;
161
168
162
169
for (String arg : args ) {
163
170
String [] argPieces = arg .split ("=" , 2 );
@@ -188,14 +195,16 @@ public static TaggedFileRecord createRecord(Properties config,
188
195
tagColumn = Integer .valueOf (argPieces [1 ]);
189
196
} else if (argPieces [0 ].equalsIgnoreCase (COMMENTS )) {
190
197
comments = Boolean .valueOf (argPieces [1 ]);
198
+ } else if (argPieces [0 ].equalsIgnoreCase (SKIP_MWT )) {
199
+ skipMWT = Boolean .valueOf (argPieces [1 ]);
191
200
} else {
192
201
throw new IllegalArgumentException ("TaggedFileRecord argument " +
193
202
argPieces [0 ] + " is unknown" );
194
203
}
195
204
}
196
205
return new TaggedFileRecord (file , format , encoding , tagSeparator ,
197
206
treeTransformer , treeNormalizer , trf , treeRange ,
198
- treeFilter , wordColumn , tagColumn , comments );
207
+ treeFilter , wordColumn , tagColumn , comments , skipMWT );
199
208
}
200
209
201
210
public static String getEncoding (Properties config ) {
0 commit comments