String[] infiles = similarityCombinerParams.getStringArray(eu.excitementproject.eop.distsim.util.Configuration.IN_FILES); String tmpOutDir = similarityCombinerParams.getString(eu.excitementproject.eop.distsim.util.Configuration.NEW_TMP_DIR);
public TextProParser(ConfigurationParams params) throws InstrumentCombinationException { try { this.textProPath = params.getString("textPro-path"); this.parser = params.get("parser"); this.parserPath = params.getString("parser-path"); this.encoding = params.getString("encoding"); } catch (ConfigurationException e) { throw new InstrumentCombinationException("Nested exception in reading the configuration file", e); } }
public TextProItalianLexicalSentenceProcessor(ConfigurationParams params) throws InstrumentCombinationException{ super(null,null, null, null); try { this.textProPath = params.getString("textPro-path"); this.parser = params. get("parser"); this.parserPath = params.getString("parser-path"); this.encoding = params.getString("encoding"); } catch (ConfigurationException e) { throw new InstrumentCombinationException("Nested exception in reading the configuration file",e); } }
/** * Ctor using {@link ConfigurationParams} * @param params * @throws LexicalResourceException * @throws ConfigurationException */ public LinDistsimLexicalResource(ConfigurationParams params) throws LexicalResourceException, ConfigurationException { this(params.getString(PARAM_CONNECTION_STRING), null, null, params.getInt(PARAM_RULES_LIMIT) ); }
/** * Ctor with {@link ConfigurationParams} * @throws LexicalResourceException * @throws ConfigurationException */ public LinProximityOriginalLexicalResource(ConfigurationParams params) throws LexicalResourceException, ConfigurationException { this(params.getString(PARAM_CONNECTION_STRING), null, null, params.getInt(PARAM_RULES_LIMIT) ); }
/** * Ctor using {@link ConfigurationParams} * @param params * @throws LexicalResourceException * @throws ConfigurationException */ public AbstractDirectLexicalResource(ConfigurationParams params) throws LexicalResourceException, ConfigurationException { this(params.getString(PARAM_CONNECTION_STRING), null, null, params.getInt(PARAM_RULES_LIMIT)); }
public TextProLemmatizer(ConfigurationParams params) throws LemmatizerException{ try { command = params.getString("TextPro-lemmatizer-command"); } catch (ConfigurationException e) { throw new LemmatizerException("Nested exception while reading from the configuration file",e); } }
public WikiLexicalResource(ConfigurationParams params) throws LexicalResourceException, ConfigurationException { this( params.getFile(PARAM_STOP_WORDS), WikiExtractionType.parseExtractionTypeListOfStrings(params.getString(PARAM_EXTRACTION_TYPES)), params.getString(PARAM_DB_CONN_STRING), null, null, params.getDouble(PARAM_COOCURRENCE_THRESHOLD)); }
public WikiLexicalResourceIT(ConfigurationParams params) throws LexicalResourceException, ConfigurationException { // super( this( params.getFile(PARAM_STOP_WORDS), WikiExtractionType.parseExtractionTypeListOfStrings(params.getString(PARAM_EXTRACTION_TYPES)), params.getString(PARAM_DB_CONN_STRING), null, null, params.getDouble(PARAM_COOCURRENCE_THRESHOLD)); // wikiDbServices = new WikiLexicalResourceDBServicesThreadSafeIT(params.getString(PARAM_DB_CONN_STRING), null, null, COOCURENCE_THRESHOLD, WikiExtractionType.parseExtractionTypeListOfStrings(params.getString(PARAM_EXTRACTION_TYPES))); }
public static LinReutersFromDBLexicalResource fromParams(ConfigurationParams params) throws SQLException, ConfigurationException { String connectionString = params.getString(TransformationsConfigurationParametersNames.CONNECTION_STRING_LIN_REUTERS_PARAMETER_NAME); Connection connection = DriverManager.getConnection(connectionString); return new LinReutersFromDBLexicalResource( connection, params.getInt(TransformationsConfigurationParametersNames.LIMIT_LIN_REUTERS_PARAMETER_NAME) ); }
public WiktionaryLexicalResource(ConfigurationParams params) throws LexicalResourceException, ConfigurationException { this( params.getString(PARAM_WKT_DIRECTORY), params.getString(PARAM_POS_TAGGER_MODEL_FILE), params.getInt(PARAM_LEFT_SENSE), params.getInt(PARAM_RIGHT_SENSE), params.getBoolean(PARAM_USE_ENTRY_INFO), params.getEnumSet(WiktionaryRelation.class, PARAM_RELATIONS)); }
/** * @param params configuration params for initialization. Should include: * <li>table_file - path to the file that contains the rules, in table format. Can also be a URL. * <li>table_separator - pattern of column-separator, e.g. "->". * <li>part_of_speech - canonical name of the part-of-speech for this rule-base. For possible values, see {@link SimplerCanonicalPosTag}. * <li>relation_name - name of relation to put in rules (the same for all rules). * <li>minimum_seconds_between_loads (int) - The minimum number of seconds between each consecutive loads from the file. * <li>(NOTE: The params.getModuleName() is used as the resource_name). */ public OnlineFileBasedLexicalResource(ConfigurationParams params) throws UnsupportedPosTagStringException, IOException, ConfigurationException { super( null, params.getEnum(SimplerCanonicalPosTag.class, "part_of_speech"), params.getModuleName(), params.getString("relation_name")); this.file = params.getString("file"); this.separator = params.getString("separator"); this.minimumSecondsBetweenLoads = params.getInt("minimum_seconds_between_loads"); this.map = ValueSetMapFromStringCreator.mapFromConfigurationParams(params); }
public RedisBasedCountableIdentifiableStorage(ConfigurationParams params) throws ConfigurationException, RedisRunException { boolean bVM = false; try { bVM = params.getBoolean(eu.excitementproject.eop.redis.Configuration.REDIS_VM); } catch (ConfigurationException e) {} init(params.getString(Configuration.REDIS_FILE),bVM); }
private Boolean readClassifierOptimizationParameter() throws ConfigurationException, TeEngineMlException { Boolean ret = null; if (configurationParams.containsKey(ConfigurationParametersNames.RTE_ENGINE_CLASSIFIER_OPTIMIZATION_PARAMETER_NAME)) { String value = configurationParams.getString(ConfigurationParametersNames.RTE_ENGINE_CLASSIFIER_OPTIMIZATION_PARAMETER_NAME); if (value.equalsIgnoreCase(BiuteeConstants.CLASSIFIER_OPTIMIZATION_ACCURACY_PARAMETER_VALUE)) { ret = false; } else if (value.equalsIgnoreCase(BiuteeConstants.CLASSIFIER_OPTIMIZATION_F1_PARAMETER_VALUE)) { ret = true; } else { throw new TeEngineMlException("The parameter value \""+value+"\" is illegal for the parameter \""+ConfigurationParametersNames.RTE_ENGINE_CLASSIFIER_OPTIMIZATION_PARAMETER_NAME+"." + "\nPlease remove this parameter from the configuration file, or use one of the following parameters: \"" + BiuteeConstants.CLASSIFIER_OPTIMIZATION_ACCURACY_PARAMETER_VALUE+"\" or \""+BiuteeConstants.CLASSIFIER_OPTIMIZATION_F1_PARAMETER_VALUE+"\"."); } } return ret; }
/** * Build a string-to-string bidirectional multi-map according to the specification in the given configuration params. * * @param params * <p>should include EITHER the following params: * <li>table_file - path or URL of a text-file that contains the map, in two-column format; see {@link #mapFromTwoColumnsText}. * <li><li>(can be replaced with table_contents - the contents of the file) * <li>table_separator - the pattern that separates between the columns in the file, e.g. "->". * <p>OR the following params: * <li>wiki_file - path or URL of a text-file that contains the map, in wiki-text format; see {@link #mapFromWikiText}. * <li><li>(can be replaced with wiki_contents - the contents of the file) * * @return a map built from that text file. * @throws ConfigurationException * @throws IOException */ public static Map<String,ValueSetMap<String,String>> mapOfMapsFromConfigurationParams(ConfigurationParams params) throws IOException, ConfigurationException { if (params.containsKey("file")) { return mapOfMapsFromText( FileUtils.loadFileOrUrlToList(params.getString("file")), params.getString("table_separator")); } else if (params.containsKey("contents")) { return mapOfMapsFromText( params.getString("contents").split("[\n\r]+"), params.getString("table_separator")); } else { throw new ConfigurationException("configuration params should contain either 'file' or 'contents' ("+params+")"); } }
/** * @param params configuration params for initialization. Should include: * <li>table_file - path to the file that contains the rules, in table format. Can also be a URL. * <li>table_separator - pattern of column-separator, e.g. "->". * <li>part_of_speech - canonical name of the part-of-speech for this rule-base. For possible values, see {@link SimplerCanonicalPosTag}. * <li>relation_name - name of relation to put in rules (the same for all rules). * <li>(NOTE: The params.getModuleName() is used as the resource_name). */ public FileBasedLexicalResource(ConfigurationParams params) throws UnsupportedPosTagStringException, IOException, ConfigurationException { super( ValueSetMapFromStringCreator.mapFromConfigurationParams(params), params.getEnum(SimplerCanonicalPosTag.class, "part_of_speech"), params.getModuleName(), params.getString("relation_name")); } }
if (params.containsKey("table_file")) { return mapFromTwoColumnsText( FileUtils.loadFileOrUrlToList(params.getString("table_file")), params.getString("table_separator")); } else if (params.containsKey("table_contents")) { return mapFromTwoColumnsText( params.getString("table_contents").split("[\n\r]+"), params.getString("table_separator")); } else if (params.containsKey("wiki_file")) { return mapFromWikiText( FileUtils.loadFileOrUrlToList(params.getString("wiki_file")), params.containsKey("add_heading_to_heading_match")? params.getBoolean("add_heading_to_heading_match"): false, params.containsKey("headings_are_keys")? params.getBoolean("headings_are_keys"): false } else if (params.containsKey("wiki_contents")) { return mapFromWikiText( params.getString("wiki_contents").split("[\n\r]+"), params.containsKey("add_heading_to_heading_match")? params.getBoolean("add_heading_to_heading_match"): false, params.containsKey("headings_are_keys")? params.getBoolean("headings_are_keys"): false
@Override public BasicParser getParserInstance() throws ParserRunException { if (m_EnglishSingleTreeParser == null) { String parserHost; int parserPort; try { parserHost = this.m_processingToolsConf.getString("parser-host"); } catch (ConfigurationException e) { throw new ParserRunException("can't get parser-host from config file.", e); } try { parserPort = this.m_processingToolsConf.getInt("parser-port"); } catch (ConfigurationException e) { throw new ParserRunException("can't get parser-port from config file.", e); } m_EnglishSingleTreeParser = ParserUtils.getInitializedStandardParser(this.m_PosTagger, this.m_Tokenizer, parserHost, parserPort); m_EnglishSingleTreeParser.init(); } return m_EnglishSingleTreeParser; }