Return-Path: X-Original-To: apmail-commons-commits-archive@minotaur.apache.org Delivered-To: apmail-commons-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B0560644F for ; Wed, 27 Jul 2011 02:57:33 +0000 (UTC) Received: (qmail 86261 invoked by uid 500); 27 Jul 2011 02:57:33 -0000 Delivered-To: apmail-commons-commits-archive@commons.apache.org Received: (qmail 85972 invoked by uid 500); 27 Jul 2011 02:57:31 -0000 Mailing-List: contact commits-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@commons.apache.org Delivered-To: mailing list commits@commons.apache.org Received: (qmail 85965 invoked by uid 99); 27 Jul 2011 02:57:30 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 27 Jul 2011 02:57:30 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 27 Jul 2011 02:57:27 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id CBF562388994 for ; Wed, 27 Jul 2011 02:57:06 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1151318 - /commons/proper/codec/trunk/src/java/org/apache/commons/codec/language/bm/PhoneticEngine.java Date: Wed, 27 Jul 2011 02:57:06 -0000 To: commits@commons.apache.org From: ggregory@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20110727025706.CBF562388994@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: ggregory Date: Wed Jul 27 02:57:05 2011 New Revision: 1151318 URL: http://svn.apache.org/viewvc?rev=1151318&view=rev Log: Better names: languageArg -> languageSet Modified: commons/proper/codec/trunk/src/java/org/apache/commons/codec/language/bm/PhoneticEngine.java Modified: commons/proper/codec/trunk/src/java/org/apache/commons/codec/language/bm/PhoneticEngine.java URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/java/org/apache/commons/codec/language/bm/PhoneticEngine.java?rev=1151318&r1=1151317&r2=1151318&view=diff ============================================================================== --- commons/proper/codec/trunk/src/java/org/apache/commons/codec/language/bm/PhoneticEngine.java (original) +++ commons/proper/codec/trunk/src/java/org/apache/commons/codec/language/bm/PhoneticEngine.java Wed Jul 27 02:57:05 2011 @@ -132,8 +132,8 @@ public class PhoneticEngine { * @return the encoding of the input */ public String encode(String input) { - Set languageArg = this.lang.guessLanguages(input); - return phoneticUtf8(input, languageArg); + Set languageSet = this.lang.guessLanguages(input); + return phoneticUtf8(input, languageSet); } /** @@ -141,13 +141,13 @@ public class PhoneticEngine { * * @param input * String to phoneticise; a String with dashes or spaces separating each word - * @param languageArg + * @param languageSet * @return a phonetic representation of the input; a String containing '-'-separated phonetic representations of the input */ - public String phoneticUtf8(String input, final Set languageArg) { - List rules = Rule.instance(this.nameType, RuleType.RULES, languageArg); + public String phoneticUtf8(String input, final Set languageSet) { + List rules = Rule.instance(this.nameType, RuleType.RULES, languageSet); List finalRules1 = Rule.instance(this.nameType, this.ruleType, "common"); - List finalRules2 = Rule.instance(this.nameType, this.ruleType, languageArg); + List finalRules2 = Rule.instance(this.nameType, this.ruleType, languageSet); // tidy the input // lower case is a locale-dependent operation @@ -215,13 +215,13 @@ public class PhoneticEngine { // loop over each char in the input - we will handle the increment manually for (int i = 0; i < input.length();) { - RulesApplication rulesApplication = new RulesApplication(rules, languageArg, input, phonetic, i).invoke(); + RulesApplication rulesApplication = new RulesApplication(rules, languageSet, input, phonetic, i).invoke(); i = rulesApplication.getI(); phonetic = rulesApplication.getPhonetic(); } - phonetic = applyFinalRules(phonetic, finalRules1, languageArg, false); - phonetic = applyFinalRules(phonetic, finalRules2, languageArg, true); + phonetic = applyFinalRules(phonetic, finalRules1, languageSet, false); + phonetic = applyFinalRules(phonetic, finalRules2, languageSet, true); return phonetic; }