@@ -36,6 +36,7 @@ public class DriverOptions {
3636 protected int col = -1 ;
3737 protected int debug = -1 ;
3838 protected String semanticTypes ;
39+ protected boolean semanticTypesPre ;
3940 // Used to pass in a list of known Semantic Types - e.g. User-stated, or previously identified in some manner
4041 protected String knownTypes ;
4142 protected boolean noAnalysis ;
@@ -110,6 +111,7 @@ public DriverOptions(final DriverOptions other) {
110111 this .pluginMode = other .pluginMode ;
111112 this .resolutionMode = other .resolutionMode ;
112113 this .samples = other .samples ;
114+ this .semanticTypesPre = other .semanticTypesPre ;
113115 this .signature = other .signature ;
114116 this .skip = other .skip ;
115117 this .threshold = other .threshold ;
@@ -164,14 +166,14 @@ public void apply(final TextAnalyzer analyzer) throws IOException {
164166 // If the argument starts with a '[' assume it is an inline definition, if not assume it is a file
165167 if (this .semanticTypes .charAt (0 ) == '[' )
166168 analyzer .getPlugins ().registerPlugins (new StringReader (this .semanticTypes ),
167- analyzer .getStreamName (), analyzer .getConfig ());
169+ analyzer .getStreamName (), analyzer .getConfig (), semanticTypesPre );
168170 else {
169171 if (!Files .isRegularFile (Paths .get (this .semanticTypes ))) {
170172 System .err .println ("ERROR: Failed to read Semantic Types file: " + this .semanticTypes );
171173 System .exit (1 );
172174 }
173175 try (FileReader logicalTypes = new FileReader (this .semanticTypes , StandardCharsets .UTF_8 )) {
174- analyzer .getPlugins ().registerPlugins (logicalTypes , analyzer .getStreamName (), analyzer .getConfig ());
176+ analyzer .getPlugins ().registerPlugins (logicalTypes , analyzer .getStreamName (), analyzer .getConfig (), semanticTypesPre );
175177 }
176178 }
177179 } catch (SecurityException | FTAPluginException e ) {
@@ -314,6 +316,8 @@ else if ("--samples".equals(args[idx]))
314316 samples = true ;
315317 else if ("--semanticType" .equals (args [idx ]))
316318 semanticTypes = nextStringArg (args , idx ++);
319+ else if ("--semanticTypesPre" .equals (args [idx ]))
320+ semanticTypesPre = true ;
317321 else if ("--signature" .equals (args [idx ]))
318322 signature = true ;
319323 else if ("--skip" .equals (args [idx ]))
0 commit comments