@@ -90,6 +90,8 @@ public class StanfordCoreNLPServer implements Runnable {
9090 protected static String blockList = null ;
9191 @ ArgumentParser .Option (name ="stanford" , gloss ="If true, do special options (domain blockList, timeout modifications) for public Stanford server" )
9292 protected boolean stanford = false ;
93+ @ ArgumentParser .Option (name ="srparser" , gloss ="If true, use the srparser by default if possible. Should save speed & memory on large queries" )
94+ protected boolean srparser = false ;
9395
9496 /** List of server specific properties **/
9597 private static final List <String > serverSpecificProperties = ArgumentParser .listOptions (StanfordCoreNLPServer .class );
@@ -521,6 +523,13 @@ private Properties getProperties(HttpExchange httpExchange) throws UnsupportedEn
521523 // don't enforce requirements for non-English
522524 if (!LanguageInfo .getLanguageFromString (language ).equals (LanguageInfo .HumanLanguage .ENGLISH ))
523525 props .setProperty ("enforceRequirements" , "false" );
526+ // check if the server is set to use the srparser, and if so,
527+ // set the parse.model to be srparser.model
528+ // also, check properties for the srparser.model prop
529+ // perhaps some languages don't have a default set for that
530+ if (srparser && languageSpecificProperties .containsKey ("srparser.model" )) {
531+ props .setProperty ("parse.model" , languageSpecificProperties .getProperty ("srparser.model" ));
532+ }
524533 } catch (IOException e ) {
525534 err ("Failure to load language specific properties: " + languagePropertiesFile + " for " + language );
526535 }
0 commit comments