Skip to content

Commit

Permalink
bugfix for WebUI use of multiple WILDCARD languages
Browse files Browse the repository at this point in the history
  • Loading branch information
jzell committed Sep 18, 2015
1 parent b9248e0 commit 635bb1f
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,9 @@ public final String getTreeTaggerLangName() {
public final String getResourceFolder() {
return this.resourceFolder;
}

@Override
public String toString() {
return getName();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*
*/
public class NormalizationManager extends GenericResourceManager {
protected static HashMap<Language, NormalizationManager> instances = new HashMap<Language, NormalizationManager>();
protected static HashMap<String, NormalizationManager> instances = new HashMap<String, NormalizationManager>();
// PATTERNS TO READ RESOURCES "RULES" AND "NORMALIZATION"
private Pattern paReadNormalizations = Pattern.compile("\"(.*?)\",\"(.*?)\"");

Expand Down Expand Up @@ -73,10 +73,10 @@ private NormalizationManager(String language) {
public static NormalizationManager getInstance(Language language) {
if(!instances.containsKey(language)) {
NormalizationManager nm = new NormalizationManager(language.getResourceFolder());
instances.put(language, nm);
instances.put(language.getName(), nm);
}

return instances.get(language);
return instances.get(language.getName());
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
*
*/
public class RePatternManager extends GenericResourceManager {
protected static HashMap<Language, RePatternManager> instances = new HashMap<Language, RePatternManager>();
protected static HashMap<String, RePatternManager> instances = new HashMap<String, RePatternManager>();

// STORE PATTERNS AND NORMALIZATIONS
private TreeMap<String, String> hmAllRePattern;
Expand Down Expand Up @@ -54,10 +54,10 @@ private RePatternManager(String language) {
public static RePatternManager getInstance(Language language) {
if(!instances.containsKey(language)) {
RePatternManager nm = new RePatternManager(language.getResourceFolder());
instances.put(language, nm);
instances.put(language.getName(), nm);
}

return instances.get(language);
return instances.get(language.getName());
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
*
*/
public class RuleManager extends GenericResourceManager {
protected static HashMap<Language, RuleManager> instances = new HashMap<Language, RuleManager>();
protected static HashMap<String, RuleManager> instances = new HashMap<String, RuleManager>();

// PATTERNS TO READ RESOURCES "RULES" AND "NORMALIZATION"
Pattern paReadRules = Pattern.compile("RULENAME=\"(.*?)\",EXTRACTION=\"(.*?)\",NORM_VALUE=\"(.*?)\"(.*)");
Expand Down Expand Up @@ -104,10 +104,10 @@ protected RuleManager(String language) {
public static RuleManager getInstance(Language language) {
if(!instances.containsKey(language)) {
RuleManager nm = new RuleManager(language.getResourceFolder());
instances.put(language, nm);
instances.put(language.getName(), nm);
}

return instances.get(language);
return instances.get(language.getName());
}

/**
Expand Down

0 comments on commit 635bb1f

Please sign in to comment.