Author: tn Date: Wed Aug 29 21:29:49 2012 New Revision: 1378746 URL: http://svn.apache.org/viewvc?rev=1378746&view=rev Log: Checkstyle fixes.
Modified: commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/bm/BeiderMorseEncoder.java commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/bm/Languages.java commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/bm/PhoneticEngine.java commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/bm/Rule.java Modified: commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/bm/BeiderMorseEncoder.java URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/bm/BeiderMorseEncoder.java?rev=1378746&r1=1378745&r2=1378746&view=diff ============================================================================== --- commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/bm/BeiderMorseEncoder.java (original) +++ commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/bm/BeiderMorseEncoder.java Wed Aug 29 21:29:49 2012 @@ -23,7 +23,8 @@ import org.apache.commons.codec.StringEn /** * Encodes strings into their Beider-Morse phonetic encoding. * <p> - * Beider-Morse phonetic encodings are optimised for family names. However, they may be useful for a wide range of words. + * Beider-Morse phonetic encodings are optimised for family names. However, they may be useful for a wide range + * of words. * <p> * This encoder is intentionally mutable to allow dynamic configuration through bean properties. As such, it * is mutable, and may not be thread-safe. If you require a guaranteed thread-safe encoding then use @@ -55,7 +56,7 @@ import org.apache.commons.codec.StringEn * If multiple hyphenated words where found, or if the word may contain a name prefix, each encoded word is placed * in elipses and these blocks are then joined with hyphens. For example, "<code>d'ortley</code>" has a possible * prefix. The form without prefix encodes to "<code>ortlaj|ortlej</code>", while the form with prefix encodes to - * "<code>dortlaj|dortlej</code>". Thus, the full, combined encoding is "<code>(ortlaj|ortlej)-(dortlaj|dortlej)</code>". + * "<code>dortlaj|dortlej</code>". Thus, the full, combined encoding is "{@code (ortlaj|ortlej)-(dortlaj|dortlej)}". * <p> * The encoded forms are often quite a bit longer than the input strings. This is because a single input may have many * potential phonetic interpretations. For example, "<code>Renault</code>" encodes to @@ -121,7 +122,8 @@ public class BeiderMorseEncoder implemen * Sets how multiple possible phonetic encodings are combined. * * @param concat - * true if multiple encodings are to be combined with a '|', false if just the first one is to be considered + * true if multiple encodings are to be combined with a '|', false if just the first one is + * to be considered */ public void setConcat(boolean concat) { this.engine = new PhoneticEngine(this.engine.getNameType(), Modified: commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/bm/Languages.java URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/bm/Languages.java?rev=1378746&r1=1378745&r2=1378746&view=diff ============================================================================== --- commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/bm/Languages.java (original) +++ commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/bm/Languages.java Wed Aug 29 21:29:49 2012 @@ -36,9 +36,10 @@ import java.util.Set; * The format of these resources is the following: * <ul> * <li><b>Language:</b> a single string containing no whitespace</li> - * <li><b>End-of-line comments:</b> Any occurance of '//' will cause all text following on that line to be discarded as a comment.</li> - * <li><b>Multi-line comments:</b> Any line starting with '/*' will start multi-line commenting mode. This will skip all content until a - * line ending in '*' and '/' is found.</li> + * <li><b>End-of-line comments:</b> Any occurrence of '//' will cause all text following on that line to be + * discarded as a comment.</li> + * <li><b>Multi-line comments:</b> Any line starting with '/*' will start multi-line commenting mode. + * This will skip all content until a line ending in '*' and '/' is found.</li> * <li><b>Blank lines:</b> All blank lines will be skipped.</li> * </ul> * <p> Modified: commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/bm/PhoneticEngine.java URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/bm/PhoneticEngine.java?rev=1378746&r1=1378745&r2=1378746&view=diff ============================================================================== --- commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/bm/PhoneticEngine.java (original) +++ commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/bm/PhoneticEngine.java Wed Aug 29 21:29:49 2012 @@ -231,11 +231,16 @@ public class PhoneticEngine { static { NAME_PREFIXES.put(NameType.ASHKENAZI, - Collections.unmodifiableSet(new HashSet<String>(Arrays.asList("bar", "ben", "da", "de", "van", "von")))); - NAME_PREFIXES.put(NameType.SEPHARDIC, Collections.unmodifiableSet(new HashSet<String>(Arrays.asList("al", "el", "da", "dal", "de", - "del", "dela", "de la", "della", "des", "di", "do", "dos", "du", "van", "von")))); - NAME_PREFIXES.put(NameType.GENERIC, Collections.unmodifiableSet(new HashSet<String>(Arrays.asList("da", "dal", "de", "del", "dela", - "de la", "della", "des", "di", "do", "dos", "du", "van", "von")))); + Collections.unmodifiableSet( + new HashSet<String>(Arrays.asList("bar", "ben", "da", "de", "van", "von")))); + NAME_PREFIXES.put(NameType.SEPHARDIC, + Collections.unmodifiableSet( + new HashSet<String>(Arrays.asList("al", "el", "da", "dal", "de", "del", "dela", "de la", + "della", "des", "di", "do", "dos", "du", "van", "von")))); + NAME_PREFIXES.put(NameType.GENERIC, + Collections.unmodifiableSet( + new HashSet<String>(Arrays.asList("da", "dal", "de", "del", "dela", "de la", "della", + "des", "di", "do", "dos", "du", "van", "von")))); } /** @@ -278,7 +283,7 @@ public class PhoneticEngine { * Joins some strings with an internal separator. * @param strings Strings to join * @param sep String to separate them with - * @return a single String consisting of each element of <code>strings</code> interleaved by <code>sep</code> + * @return a single String consisting of each element of <code>strings</code> interleaved by <code>sep</code> */ private static String join(Iterable<String> strings, String sep) { StringBuilder sb = new StringBuilder(); @@ -403,7 +408,8 @@ public class PhoneticEngine { * @param input * String to phoneticise; a String with dashes or spaces separating each word * @param languageSet - * @return a phonetic representation of the input; a String containing '-'-separated phonetic representations of the input + * @return a phonetic representation of the input; a String containing '-'-separated phonetic representations + * of the input */ public String encode(String input, final Languages.LanguageSet languageSet) { final List<Rule> rules = Rule.getInstance(this.nameType, RuleType.RULES, languageSet); Modified: commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/bm/Rule.java URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/bm/Rule.java?rev=1378746&r1=1378745&r2=1378746&view=diff ============================================================================== --- commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/bm/Rule.java (original) +++ commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/bm/Rule.java Wed Aug 29 21:29:49 2012 @@ -127,7 +127,8 @@ public class Rule { } public Phoneme join(Phoneme right) { - return new Phoneme(this.phonemeText.toString() + right.phonemeText.toString(), this.languages.restrictTo(right.languages)); + return new Phoneme(this.phonemeText.toString() + right.phonemeText.toString(), + this.languages.restrictTo(right.languages)); } } @@ -168,8 +169,8 @@ public class Rule { private static final String HASH_INCLUDE = "#include"; - private static final Map<NameType, Map<RuleType, Map<String, List<Rule>>>> RULES = new EnumMap<NameType, Map<RuleType, Map<String, List<Rule>>>>( - NameType.class); + private static final Map<NameType, Map<RuleType, Map<String, List<Rule>>>> RULES = + new EnumMap<NameType, Map<RuleType, Map<String, List<Rule>>>>(NameType.class); static { for (NameType s : NameType.values()) { @@ -207,7 +208,8 @@ public class Rule { } private static String createResourceName(NameType nameType, RuleType rt, String lang) { - return String.format("org/apache/commons/codec/language/bm/%s_%s_%s.txt", nameType.getName(), rt.getName(), lang); + return String.format("org/apache/commons/codec/language/bm/%s_%s_%s.txt", + nameType.getName(), rt.getName(), lang); } private static Scanner createScanner(NameType nameType, RuleType rt, String lang) { @@ -256,7 +258,8 @@ public class Rule { * @return a list of Rules that apply */ public static List<Rule> getInstance(NameType nameType, RuleType rt, Languages.LanguageSet langs) { - return langs.isSingleton() ? getInstance(nameType, rt, langs.getAny()) : getInstance(nameType, rt, Languages.ANY); + return langs.isSingleton() ? getInstance(nameType, rt, langs.getAny()) : + getInstance(nameType, rt, Languages.ANY); } /** @@ -274,7 +277,8 @@ public class Rule { List<Rule> rules = RULES.get(nameType).get(rt).get(lang); if (rules == null) { - throw new IllegalArgumentException(String.format("No rules found for %s, %s, %s.", nameType.getName(), rt.getName(), lang)); + throw new IllegalArgumentException(String.format("No rules found for %s, %s, %s.", + nameType.getName(), rt.getName(), lang)); } return rules; @@ -364,7 +368,8 @@ public class Rule { String[] parts = line.split("\\s+"); if (parts.length != 4) { // FIXME: consider throwing an IllegalStateException like in parsePhonemeExpr - // System.err.println("Warning: malformed rule statement split into " + parts.length + " parts: " + rawLine); +// System.err.println("Warning: malformed rule statement split into " + parts.length + +// " parts: " + rawLine); } else { try { String pat = stripQuotes(parts[0]); @@ -487,7 +492,8 @@ public class Rule { return new RPattern() { @Override public boolean isMatch(CharSequence input) { - return input.length() > 0 && contains(bContent, input.charAt(input.length() - 1)) == shouldMatch; + return input.length() > 0 && + contains(bContent, input.charAt(input.length() - 1)) == shouldMatch; } }; }