Skip to content

Commit

Permalink
added numberOfSimilarWords to config file
Browse files Browse the repository at this point in the history
  • Loading branch information
pkolb committed Jun 27, 2017
1 parent b6f1ac9 commit f1e257f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/de/linguatools/disco/ConfigFile.java
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ public static FileFormat parseFileFormat(String fileFormat){
public boolean addInverseRelations = true;
// bz
public int numberFeatureWords = 30000;
// number of most similar words to store for each word. Given by DISCOBuilder
// parameter -nBest (default 300) or Import parameter -nBest.
// 0 for word spaces of type COL.
public int numberOfSimilarWords = 0;
public String weightingMethod = "lin";
public float minWeight = 0.1F;
public SimilarityMeasure similarityMeasure = SimilarityMeasure.KOLB;
Expand Down Expand Up @@ -213,6 +217,10 @@ public ConfigFile(String dirName) throws FileNotFoundException, IOException,
numberFeatureWords = Integer.parseInt(props.getProperty("numberFeatureWords"));
}

if( props.getProperty("numberOfSimilarWords") != null && !props.getProperty("numberOfSimilarWords").isEmpty() ){
numberOfSimilarWords = Integer.parseInt(props.getProperty("numberOfSimilarWords"));
}

if( props.getProperty("weightingMethod") != null && !props.getProperty("weightingMethod").isEmpty() ){
weightingMethod = props.getProperty("weightingMethod");
}
Expand Down Expand Up @@ -319,6 +327,7 @@ public void write(String dirName) throws IOException{
props.setProperty("wordByDocument", String.valueOf(wordByDocument));
props.setProperty("addInverseRelations", String.valueOf(addInverseRelations));
props.setProperty("numberFeatureWords", String.valueOf(numberFeatureWords));
props.setProperty("numberOfSimilarWords", String.valueOf(numberOfSimilarWords));
props.setProperty("weightingMethod", weightingMethod);
props.setProperty("minWeight", String.valueOf(minWeight));
props.setProperty("similarityMeasure", String.valueOf(similarityMeasure));
Expand Down

0 comments on commit f1e257f

Please sign in to comment.