Mercurial > hg > mpdl-group
diff software/mpdl-services/mpiwg-mpdl-lt/src/de/mpg/mpiwg/berlin/mpdl/lt/text/norm/Normalizer.java @ 23:e845310098ba
diverse Korrekturen
author | Josef Willenborg <jwillenborg@mpiwg-berlin.mpg.de> |
---|---|
date | Tue, 27 Nov 2012 12:35:19 +0100 |
parents | 7d6d969b10cf |
children |
line wrap: on
line diff
--- a/software/mpdl-services/mpiwg-mpdl-lt/src/de/mpg/mpiwg/berlin/mpdl/lt/text/norm/Normalizer.java Wed Dec 14 13:57:09 2011 +0100 +++ b/software/mpdl-services/mpiwg-mpdl-lt/src/de/mpg/mpiwg/berlin/mpdl/lt/text/norm/Normalizer.java Tue Nov 27 12:35:19 2012 +0100 @@ -2,7 +2,6 @@ import java.io.IOException; import java.io.StringReader; -import java.util.ArrayList; import de.mpg.mpiwg.berlin.mpdl.exception.ApplicationException; import de.mpg.mpiwg.berlin.mpdl.lt.general.Language; @@ -15,8 +14,6 @@ import de.mpg.mpiwg.berlin.mpdl.lt.text.norm.lang.MpdlNormalizerLexLA; import de.mpg.mpiwg.berlin.mpdl.lt.text.norm.lang.MpdlNormalizerLexNL; import de.mpg.mpiwg.berlin.mpdl.lt.text.norm.lang.MpdlNormalizerLexZH; -import de.mpg.mpiwg.berlin.mpdl.lt.text.reg.Regularization; -import de.mpg.mpiwg.berlin.mpdl.lt.text.reg.RegularizationManager; public class Normalizer { public static int NONE = -1; // no normalization @@ -57,16 +54,6 @@ String normStr = s; if (useSpecialNormFunction()) normStr = removeSpecialNWDMarks(normStr); - if (useRegFunction()) { - // try to regularize the string to the norm form over predefined regularizations - RegularizationManager regManager = RegularizationManager.getInstance(); - ArrayList<Regularization> regs = regManager.findRegsByOrig(language, s); - if (regs != null && regs.size() > 0) { - Regularization reg = regs.get(0); // only one: the first one - String regNormStr = reg.getNorm(); - normStr = regNormStr; - } - } if (useNormFunction()) { // normalize the string by string replacements if (normMode == DICTIONARY) { @@ -82,16 +69,6 @@ return normStr; } - private boolean useRegFunction() { - boolean useReg = false; - for (int i=0; i< normFunctions.length; i++) { - String function = normFunctions[i]; - if (function.equals("reg")) - return true; - } - return useReg; - } - private boolean useNormFunction() { boolean useNorm = false; for (int i=0; i< normFunctions.length; i++) { @@ -188,7 +165,7 @@ if (mode == DISPLAY) mpdlNormalizerLex.yybegin(MpdlNormalizerLexFR.DISP); else if (mode == DICTIONARY) - mpdlNormalizerLex.yybegin(MpdlNormalizerLexFR.DICT_ASCII); + mpdlNormalizerLex.yybegin(MpdlNormalizerLexFR.DICT); else if (mode == SEARCH) mpdlNormalizerLex.yybegin(MpdlNormalizerLexFR.SEARCH); while (token != null) {