public static Set<String> getLexicalRuleBasesForMultiWords(ConfigurationFile configurationFile) throws ConfigurationException { Set<String> ret = new LinkedHashSet<String>(); ConfigurationParams knowledgeResourcesParams = configurationFile.getModuleConfiguration(TRANSFORMATIONS_MODULE_NAME); String valueAsString = knowledgeResourcesParams.get(LEXICAL_RESOURCES_RETRIEVE_MULTIWORDS_PARAMETER_NAME); if (valueAsString.trim().length()>0) { Set<KnowledgeResource> resources = knowledgeResourcesParams.getEnumSet(KnowledgeResource.class, LEXICAL_RESOURCES_RETRIEVE_MULTIWORDS_PARAMETER_NAME); for (KnowledgeResource resource : resources) { ret.add(resource.getDisplayName()); } } return ret; }
public VerbOceanLexicalResource(ConfigurationParams params) throws LexicalResourceException, ConfigurationException { this( params.getDouble(PARAM_SCORE_THRESHOLD), params.getFile(PARAM_FILE), params.getEnumSet(RelationType.class, PARAM_ALLOWED_RELATIONS)); } /////////////////////////////////////////////////////////////// PUBLIC ////////////////////////////////////////////////////////////
private void readExcludeList() throws OperationException { try { ConfigurationParams transformationsParameters = configurationFile.getModuleConfiguration(ConfigurationParametersNames.TRANSFORMATIONS_MODULE_NAME); if (transformationsParameters.containsKey(ConfigurationParametersNames.EXCLUDE_TRANSFORMATIONS_PARAMETER_NAME)) { excludeTransformations = Collections.unmodifiableSet(transformationsParameters.getEnumSet(SingleOperationType.class, ConfigurationParametersNames.EXCLUDE_TRANSFORMATIONS_PARAMETER_NAME)); } else { excludeTransformations = Collections.<SingleOperationType>unmodifiableSet(Collections.<SingleOperationType>emptySet()); } } catch(ConfigurationException e) { throw new OperationException("Failed to initialize.",e); } for (SingleOperationType operation : excludeTransformations) { if (operation.isRuleApplication()) {throw new OperationException("Illegal value for parameter "+ConfigurationParametersNames.EXCLUDE_TRANSFORMATIONS_PARAMETER_NAME+". Rule application operation type should not be specified in this parameter.");} } }
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)); }
public WordnetLexicalResource(ConfigurationParams params) throws LexicalResourceException, ConfigurationException { this( params.getDirectory(PARAM_WN_DIR), params.getBoolean(PARAM_ONLY_FIRST_LEFT), params.getBoolean(PARAM_ONLY_FIRST_RIGHT), params.getEnumSet(WordNetRelation.class, PARAM_DEFAULT_RELATIONS), params.getInt(PARAM_CHAINING_LENGTH), params.containsKey(PARAM_WORDNET_DICTIONARY_IMPLEMENTATION_TYPE) ? params.getEnum(WordnetDictionaryImplementationType.class, PARAM_WORDNET_DICTIONARY_IMPLEMENTATION_TYPE) : null); }