/lucene-3.6.0/contrib/analyzers/kuromoji/src/java/org/apache/lucene/analysis/ja/util/ToStringUtil.java
Java | 1039 lines | 989 code | 11 blank | 39 comment | 367 complexity | ba37499ca1f0423cffe90306a2fbca3f MD5 | raw file
Possible License(s): GPL-3.0, LGPL-2.1, MIT, BSD-3-Clause, CPL-1.0, Apache-2.0, AGPL-1.0, GPL-2.0
- package org.apache.lucene.analysis.ja.util;
- /**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- import java.io.IOException;
- import java.util.HashMap;
- /**
- * Utility class for english translations of morphological data,
- * used only for debugging.
- */
- public class ToStringUtil {
- // a translation map for parts of speech, only used for reflectWith
- private static final HashMap<String,String> posTranslations = new HashMap<String,String>();
- static {
- posTranslations.put("??", "noun");
- posTranslations.put("??-??", "noun-common");
- posTranslations.put("??-????", "noun-proper");
- posTranslations.put("??-????-??", "noun-proper-misc");
- posTranslations.put("??-????-??", "noun-proper-person");
- posTranslations.put("??-????-??-??", "noun-proper-person-misc");
- posTranslations.put("??-????-??-?", "noun-proper-person-surname");
- posTranslations.put("??-????-??-?", "noun-proper-person-given_name");
- posTranslations.put("??-????-??", "noun-proper-organization");
- posTranslations.put("??-????-??", "noun-proper-place");
- posTranslations.put("??-????-??-??", "noun-proper-place-misc");
- posTranslations.put("??-????-??-?", "noun-proper-place-country");
- posTranslations.put("??-???", "noun-pronoun");
- posTranslations.put("??-???-??", "noun-pronoun-misc");
- posTranslations.put("??-???-??", "noun-pronoun-contraction");
- posTranslations.put("??-????", "noun-adverbial");
- posTranslations.put("??-????", "noun-verbal");
- posTranslations.put("??-??????", "noun-adjective-base");
- posTranslations.put("??-?", "noun-numeric");
- posTranslations.put("??-???", "noun-affix");
- posTranslations.put("??-???-??", "noun-affix-misc");
- posTranslations.put("??-???-????", "noun-affix-adverbial");
- posTranslations.put("??-???-?????", "noun-affix-aux");
- posTranslations.put("??-???-??????", "noun-affix-adjective-base");
- posTranslations.put("??-??", "noun-special");
- posTranslations.put("??-??-?????", "noun-special-aux");
- posTranslations.put("??-??", "noun-suffix");
- posTranslations.put("??-??-??", "noun-suffix-misc");
- posTranslations.put("??-??-??", "noun-suffix-person");
- posTranslations.put("??-??-??", "noun-suffix-place");
- posTranslations.put("??-??-????", "noun-suffix-verbal");
- posTranslations.put("??-??-?????", "noun-suffix-aux");
- posTranslations.put("??-??-??????", "noun-suffix-adjective-base");
- posTranslations.put("??-??-????", "noun-suffix-adverbial");
- posTranslations.put("??-??-???", "noun-suffix-classifier");
- posTranslations.put("??-??-??", "noun-suffix-special");
- posTranslations.put("??-????", "noun-suffix-conjunctive");
- posTranslations.put("??-??????", "noun-verbal_aux");
- posTranslations.put("??-?????", "noun-quotation");
- posTranslations.put("??-???????", "noun-nai_adjective");
- posTranslations.put("???", "prefix");
- posTranslations.put("???-????", "prefix-nominal");
- posTranslations.put("???-????", "prefix-verbal");
- posTranslations.put("???-?????", "prefix-adjectival");
- posTranslations.put("???-???", "prefix-numerical");
- posTranslations.put("??", "verb");
- posTranslations.put("??-??", "verb-main");
- posTranslations.put("??-???", "verb-auxiliary");
- posTranslations.put("??-??", "verb-suffix");
- posTranslations.put("???", "adjective");
- posTranslations.put("???-??", "adjective-main");
- posTranslations.put("???-???", "adjective-auxiliary");
- posTranslations.put("???-??", "adjective-suffix");
- posTranslations.put("??", "adverb");
- posTranslations.put("??-??", "adverb-misc");
- posTranslations.put("??-?????", "adverb-particle_conjunction");
- posTranslations.put("???", "adnominal");
- posTranslations.put("???", "conjunction");
- posTranslations.put("??", "particle");
- posTranslations.put("??-???", "particle-case");
- posTranslations.put("??-???-??", "particle-case-misc");
- posTranslations.put("??-???-??", "particle-case-quote");
- posTranslations.put("??-???-??", "particle-case-compound");
- posTranslations.put("??-????", "particle-conjunctive");
- posTranslations.put("??-???", "particle-dependency");
- posTranslations.put("??-???", "particle-adverbial");
- posTranslations.put("??-????", "particle-interjective");
- posTranslations.put("??-????", "particle-coordinate");
- posTranslations.put("??-???", "particle-final");
- posTranslations.put("??-????????????", "particle-adverbial/conjunctive/final");
- posTranslations.put("??-???", "particle-adnominalizer");
- posTranslations.put("??-???", "particle-adnominalizer");
- posTranslations.put("??-??", "particle-special");
- posTranslations.put("???", "auxiliary-verb");
- posTranslations.put("???", "interjection");
- posTranslations.put("??", "symbol");
- posTranslations.put("??-??", "symbol-misc");
- posTranslations.put("??-??", "symbol-period");
- posTranslations.put("??-??", "symbol-comma");
- posTranslations.put("??-??", "symbol-space");
- posTranslations.put("??-???", "symbol-open_bracket");
- posTranslations.put("??-???", "symbol-close_bracket");
- posTranslations.put("??-???????", "symbol-alphabetic");
- posTranslations.put("???", "other");
- posTranslations.put("???-??", "other-interjection");
- posTranslations.put("????", "filler");
- posTranslations.put("????", "non-verbal");
- posTranslations.put("???", "fragment");
- posTranslations.put("???", "unknown");
- }
-
- /**
- * Get the english form of a POS tag
- */
- public static String getPOSTranslation(String s) {
- return posTranslations.get(s);
- }
-
- // a translation map for inflection types, only used for reflectWith
- private static final HashMap<String,String> inflTypeTranslations = new HashMap<String,String>();
- static {
- inflTypeTranslations.put("*", "*");
- inflTypeTranslations.put("????????", "adj-group-a-o-u");
- inflTypeTranslations.put("??????", "adj-group-i");
- inflTypeTranslations.put("??????", "adj-group-ii");
- inflTypeTranslations.put("????", "non-inflectional");
- inflTypeTranslations.put("????", "special-da");
- inflTypeTranslations.put("????", "special-ta");
- inflTypeTranslations.put("??????", "classical-gotoshi");
- inflTypeTranslations.put("?????", "special-ja");
- inflTypeTranslations.put("?????", "special-nai");
- inflTypeTranslations.put("???????", "5-row-cons-r-special");
- inflTypeTranslations.put("????", "special-nu");
- inflTypeTranslations.put("????", "classical-ki");
- inflTypeTranslations.put("?????", "special-tai");
- inflTypeTranslations.put("?????", "classical-beshi");
- inflTypeTranslations.put("????", "special-ya");
- inflTypeTranslations.put("?????", "classical-maji");
- inflTypeTranslations.put("?????", "2-row-lower-cons-t");
- inflTypeTranslations.put("?????", "special-desu");
- inflTypeTranslations.put("?????", "special-masu");
- inflTypeTranslations.put("???????", "5-row-aru");
- inflTypeTranslations.put("?????", "classical-nari");
- inflTypeTranslations.put("????", "classical-ri");
- inflTypeTranslations.put("?????", "classical-keri");
- inflTypeTranslations.put("????", "classical-ru");
- inflTypeTranslations.put("????????", "5-row-cons-k-i-onbin");
- inflTypeTranslations.put("?????", "5-row-cons-s");
- inflTypeTranslations.put("??", "1-row");
- inflTypeTranslations.put("????????", "5-row-cons-w-cons-onbin");
- inflTypeTranslations.put("?????", "5-row-cons-m");
- inflTypeTranslations.put("?????", "5-row-cons-t");
- inflTypeTranslations.put("?????", "5-row-cons-r");
- inflTypeTranslations.put("??????", "irregular-suffix-suru");
- inflTypeTranslations.put("?????", "5-row-cons-g");
- inflTypeTranslations.put("??????", "irregular-suffix-zuru");
- inflTypeTranslations.put("?????", "5-row-cons-b");
- inflTypeTranslations.put("????????", "5-row-cons-w-u-onbin");
- inflTypeTranslations.put("?????", "2-row-lower-cons-d");
- inflTypeTranslations.put("??????????", "5-row-cons-k-cons-onbin-yuku");
- inflTypeTranslations.put("?????", "2-row-upper-cons-d");
- inflTypeTranslations.put("????????", "5-row-cons-k-cons-onbin");
- inflTypeTranslations.put("?????", "1-row-eru");
- inflTypeTranslations.put("?????", "4-row-cons-t");
- inflTypeTranslations.put("?????", "5-row-cons-n");
- inflTypeTranslations.put("?????", "2-row-lower-cons-h");
- inflTypeTranslations.put("?????", "4-row-cons-h");
- inflTypeTranslations.put("?????", "4-row-cons-b");
- inflTypeTranslations.put("?????", "irregular-suru");
- inflTypeTranslations.put("?????", "2-row-upper-cons-h");
- inflTypeTranslations.put("?????", "2-row-lower-cons-m");
- inflTypeTranslations.put("?????", "4-row-cons-s");
- inflTypeTranslations.put("?????", "2-row-lower-cons-g");
- inflTypeTranslations.put("?????", "kuru-kanji");
- inflTypeTranslations.put("??????", "1-row-kureru");
- inflTypeTranslations.put("????", "2-row-lower-u");
- inflTypeTranslations.put("?????", "kuru-kana");
- inflTypeTranslations.put("??", "irregular-cons-r");
- inflTypeTranslations.put("?????", "2-row-lower-cons-k");
- }
-
- /**
- * Get the english form of inflection type
- */
- public static String getInflectionTypeTranslation(String s) {
- return inflTypeTranslations.get(s);
- }
- // a translation map for inflection forms, only used for reflectWith
- private static final HashMap<String,String> inflFormTranslations = new HashMap<String,String>();
- static {
- inflFormTranslations.put("*", "*");
- inflFormTranslations.put("???", "base");
- inflFormTranslations.put("?????", "classical-base");
- inflFormTranslations.put("?????", "imperfective-nu-connection");
- inflFormTranslations.put("?????", "imperfective-u-connection");
- inflFormTranslations.put("?????", "conjunctive-ta-connection");
- inflFormTranslations.put("?????", "conjunctive-te-connection");
- inflFormTranslations.put("???????", "conjunctive-gozai-connection");
- inflFormTranslations.put("????", "uninflected-connection");
- inflFormTranslations.put("???", "subjunctive");
- inflFormTranslations.put("???", "imperative-e");
- inflFormTranslations.put("?????", "conditional-contracted-1");
- inflFormTranslations.put("?????", "conditional-contracted-2");
- inflFormTranslations.put("????", "garu-connection");
- inflFormTranslations.put("???", "imperfective");
- inflFormTranslations.put("???", "conjunctive");
- inflFormTranslations.put("?????", "onbin-base");
- inflFormTranslations.put("?????", "conjunctive-de-connection");
- inflFormTranslations.put("????", "imperfective-special");
- inflFormTranslations.put("???", "imperative-i");
- inflFormTranslations.put("?????", "conjunctive-ni-connection");
- inflFormTranslations.put("????", "imperative-yo");
- inflFormTranslations.put("??????", "adnominal-special");
- inflFormTranslations.put("????", "imperative-ro");
- inflFormTranslations.put("???????", "uninflected-special-connection-2");
- inflFormTranslations.put("??????", "imperfective-reru-connection");
- inflFormTranslations.put("?????", "modern-base");
- inflFormTranslations.put("???-???", "base-onbin"); // not sure about this
- }
-
- /**
- * Get the english form of inflected form
- */
- public static String getInflectedFormTranslation(String s) {
- return inflFormTranslations.get(s);
- }
-
- /**
- * Romanize katakana with modified hepburn
- */
- public static String getRomanization(String s) {
- StringBuilder out = new StringBuilder();
- try {
- getRomanization(out, s);
- } catch (IOException bogus) {
- throw new RuntimeException(bogus);
- }
- return out.toString();
- }
-
- /**
- * Romanize katakana with modified hepburn
- */
- public static void getRomanization(Appendable builder, CharSequence s) throws IOException {
- final int len = s.length();
- for (int i = 0; i < len; i++) {
- // maximum lookahead: 3
- char ch = s.charAt(i);
- char ch2 = (i < len - 1) ? s.charAt(i + 1) : 0;
- char ch3 = (i < len - 2) ? s.charAt(i + 2) : 0;
-
- main: switch (ch) {
- case '?':
- switch (ch2) {
- case '?':
- case '?':
- case '?':
- case '?':
- case '?':
- builder.append('k');
- break main;
- case '?':
- case '?':
- case '?':
- case '?':
- case '?':
- builder.append('s');
- break main;
- case '?':
- case '?':
- case '?':
- case '?':
- case '?':
- builder.append('t');
- break main;
- case '?':
- case '?':
- case '?':
- case '?':
- case '?':
- builder.append('p');
- break main;
- }
- break;
- case '?':
- builder.append('a');
- break;
- case '?':
- if (ch2 == '?') {
- builder.append("yi");
- i++;
- } else if (ch2 == '?') {
- builder.append("ye");
- i++;
- } else {
- builder.append('i');
- }
- break;
- case '?':
- switch(ch2) {
- case '?':
- builder.append("wa");
- i++;
- break;
- case '?':
- builder.append("wi");
- i++;
- break;
- case '?':
- builder.append("wu");
- i++;
- break;
- case '?':
- builder.append("we");
- i++;
- break;
- case '?':
- builder.append("wo");
- i++;
- break;
- case '?':
- builder.append("wyu");
- i++;
- break;
- default:
- builder.append('u');
- break;
- }
- break;
- case '?':
- builder.append('e');
- break;
- case '?':
- if (ch2 == '?') {
- builder.append('?');
- i++;
- } else {
- builder.append('o');
- }
- break;
- case '?':
- builder.append("ka");
- break;
- case '?':
- if (ch2 == '?' && ch3 == '?') {
- builder.append("ky?");
- i += 2;
- } else if (ch2 == '?' && ch3 == '?') {
- builder.append("ky?");
- i += 2;
- } else if (ch2 == '?') {
- builder.append("kya");
- i++;
- } else if (ch2 == '?') {
- builder.append("kyo");
- i++;
- } else if (ch2 == '?') {
- builder.append("kyu");
- i++;
- } else if (ch2 == '?') {
- builder.append("kye");
- i++;
- } else {
- builder.append("ki");
- }
- break;
- case '?':
- switch(ch2) {
- case '?':
- builder.append("kwa");
- i++;
- break;
- case '?':
- builder.append("kwi");
- i++;
- break;
- case '?':
- builder.append("kwe");
- i++;
- break;
- case '?':
- builder.append("kwo");
- i++;
- break;
- case '?':
- builder.append("kwa");
- i++;
- break;
- default:
- builder.append("ku");
- break;
- }
- break;
- case '?':
- builder.append("ke");
- break;
- case '?':
- if (ch2 == '?') {
- builder.append("k?");
- i++;
- } else {
- builder.append("ko");
- }
- break;
- case '?':
- builder.append("sa");
- break;
- case '?':
- if (ch2 == '?' && ch3 == '?') {
- builder.append("sh?");
- i += 2;
- } else if (ch2 == '?' && ch3 == '?') {
- builder.append("sh?");
- i += 2;
- } else if (ch2 == '?') {
- builder.append("sha");
- i++;
- } else if (ch2 == '?') {
- builder.append("sho");
- i++;
- } else if (ch2 == '?') {
- builder.append("shu");
- i++;
- } else if (ch2 == '?') {
- builder.append("she");
- i++;
- } else {
- builder.append("shi");
- }
- break;
- case '?':
- if (ch2 == '?') {
- builder.append("si");
- i++;
- } else {
- builder.append("su");
- }
- break;
- case '?':
- builder.append("se");
- break;
- case '?':
- if (ch2 == '?') {
- builder.append("s?");
- i++;
- } else {
- builder.append("so");
- }
- break;
- case '?':
- builder.append("ta");
- break;
- case '?':
- if (ch2 == '?' && ch3 == '?') {
- builder.append("ch?");
- i += 2;
- } else if (ch2 == '?' && ch3 == '?') {
- builder.append("ch?");
- i += 2;
- } else if (ch2 == '?') {
- builder.append("cha");
- i++;
- } else if (ch2 == '?') {
- builder.append("cho");
- i++;
- } else if (ch2 == '?') {
- builder.append("chu");
- i++;
- } else if (ch2 == '?') {
- builder.append("che");
- i++;
- } else {
- builder.append("chi");
- }
- break;
- case '?':
- if (ch2 == '?') {
- builder.append("tsa");
- i++;
- } else if (ch2 == '?') {
- builder.append("tsi");
- i++;
- } else if (ch2 == '?') {
- builder.append("tse");
- i++;
- } else if (ch2 == '?') {
- builder.append("tso");
- i++;
- } else if (ch2 == '?') {
- builder.append("tsyu");
- i++;
- } else {
- builder.append("tsu");
- }
- break;
- case '?':
- if (ch2 == '?') {
- builder.append("ti");
- i++;
- } else if (ch2 == '?') {
- builder.append("tu");
- i++;
- } else if (ch2 == '?') {
- builder.append("tyu");
- i++;
- } else {
- builder.append("te");
- }
- break;
- case '?':
- if (ch2 == '?') {
- builder.append("t?");
- i++;
- } else {
- builder.append("to");
- }
- break;
- case '?':
- builder.append("na");
- break;
- case '?':
- if (ch2 == '?' && ch3 == '?') {
- builder.append("ny?");
- i += 2;
- } else if (ch2 == '?' && ch3 == '?') {
- builder.append("ny?");
- i += 2;
- } else if (ch2 == '?') {
- builder.append("nya");
- i++;
- } else if (ch2 == '?') {
- builder.append("nyo");
- i++;
- } else if (ch2 == '?') {
- builder.append("nyu");
- i++;
- } else if (ch2 == '?') {
- builder.append("nye");
- i++;
- } else {
- builder.append("ni");
- }
- break;
- case '?':
- builder.append("nu");
- break;
- case '?':
- builder.append("ne");
- break;
- case '?':
- if (ch2 == '?') {
- builder.append("n?");
- i++;
- } else {
- builder.append("no");
- }
- break;
- case '?':
- builder.append("ha");
- break;
- case '?':
- if (ch2 == '?' && ch3 == '?') {
- builder.append("hy?");
- i += 2;
- } else if (ch2 == '?' && ch3 == '?') {
- builder.append("hy?");
- i += 2;
- } else if (ch2 == '?') {
- builder.append("hya");
- i++;
- } else if (ch2 == '?') {
- builder.append("hyo");
- i++;
- } else if (ch2 == '?') {
- builder.append("hyu");
- i++;
- } else if (ch2 == '?') {
- builder.append("hye");
- i++;
- } else {
- builder.append("hi");
- }
- break;
- case '?':
- if (ch2 == '?') {
- builder.append("fya");
- i++;
- } else if (ch2 == '?') {
- builder.append("fyu");
- i++;
- } else if (ch2 == '?' && ch3 == '?') {
- builder.append("fye");
- i+=2;
- } else if (ch2 == '?') {
- builder.append("fyo");
- i++;
- } else if (ch2 == '?') {
- builder.append("fa");
- i++;
- } else if (ch2 == '?') {
- builder.append("fi");
- i++;
- } else if (ch2 == '?') {
- builder.append("fe");
- i++;
- } else if (ch2 == '?') {
- builder.append("fo");
- i++;
- } else {
- builder.append("fu");
- }
- break;
- case '?':
- builder.append("he");
- break;
- case '?':
- if (ch2 == '?') {
- builder.append("h?");
- i++;
- } else if (ch2 == '?') {
- builder.append("hu");
- i++;
- } else {
- builder.append("ho");
- }
- break;
- case '?':
- builder.append("ma");
- break;
- case '?':
- if (ch2 == '?' && ch3 == '?') {
- builder.append("my?");
- i += 2;
- } else if (ch2 == '?' && ch3 == '?') {
- builder.append("my?");
- i += 2;
- } else if (ch2 == '?') {
- builder.append("mya");
- i++;
- } else if (ch2 == '?') {
- builder.append("myo");
- i++;
- } else if (ch2 == '?') {
- builder.append("myu");
- i++;
- } else if (ch2 == '?') {
- builder.append("mye");
- i++;
- } else {
- builder.append("mi");
- }
- break;
- case '?':
- builder.append("mu");
- break;
- case '?':
- builder.append("mi");
- break;
- case '?':
- if (ch2 == '?') {
- builder.append("m?");
- i++;
- } else {
- builder.append("mo");
- }
- break;
- case '?':
- builder.append("ya");
- break;
- case '?':
- builder.append("yu");
- break;
- case '?':
- if (ch2 == '?') {
- builder.append("y?");
- i++;
- } else {
- builder.append("yo");
- }
- break;
- case '?':
- builder.append("ra");
- break;
- case '?':
- if (ch2 == '?' && ch3 == '?') {
- builder.append("ry?");
- i += 2;
- } else if (ch2 == '?' && ch3 == '?') {
- builder.append("ry?");
- i += 2;
- } else if (ch2 == '?') {
- builder.append("rya");
- i++;
- } else if (ch2 == '?') {
- builder.append("ryo");
- i++;
- } else if (ch2 == '?') {
- builder.append("ryu");
- i++;
- } else if (ch2 == '?') {
- builder.append("rye");
- i++;
- } else {
- builder.append("ri");
- }
- break;
- case '?':
- builder.append("ru");
- break;
- case '?':
- builder.append("re");
- break;
- case '?':
- if (ch2 == '?') {
- builder.append("r?");
- i++;
- } else {
- builder.append("ro");
- }
- break;
- case '?':
- builder.append("wa");
- break;
- case '?':
- builder.append("i");
- break;
- case '?':
- builder.append("e");
- break;
- case '?':
- builder.append("o");
- break;
- case '?':
- switch (ch2) {
- case '?':
- case '?':
- case '?':
- case '?':
- case '?':
- case '?':
- case '?':
- case '?':
- case '?':
- case '?':
- case '?':
- case '?':
- case '?':
- case '?':
- case '?':
- builder.append('m');
- break main;
- case '?':
- case '?':
- case '?':
- case '?':
- case '?':
- case '?':
- case '?':
- case '?':
- builder.append("n'");
- break main;
- default:
- builder.append("n");
- break main;
- }
- case '?':
- builder.append("ga");
- break;
- case '?':
- if (ch2 == '?' && ch3 == '?') {
- builder.append("gy?");
- i += 2;
- } else if (ch2 == '?' && ch3 == '?') {
- builder.append("gy?");
- i += 2;
- } else if (ch2 == '?') {
- builder.append("gya");
- i++;
- } else if (ch2 == '?') {
- builder.append("gyo");
- i++;
- } else if (ch2 == '?') {
- builder.append("gyu");
- i++;
- } else if (ch2 == '?') {
- builder.append("gye");
- i++;
- } else {
- builder.append("gi");
- }
- break;
- case '?':
- switch(ch2) {
- case '?':
- builder.append("gwa");
- i++;
- break;
- case '?':
- builder.append("gwi");
- i++;
- break;
- case '?':
- builder.append("gwe");
- i++;
- break;
- case '?':
- builder.append("gwo");
- i++;
- break;
- case '?':
- builder.append("gwa");
- i++;
- break;
- default:
- builder.append("gu");
- break;
- }
- break;
- case '?':
- builder.append("ge");
- break;
- case '?':
- if (ch2 == '?') {
- builder.append("g?");
- i++;
- } else {
- builder.append("go");
- }
- break;
- case '?':
- builder.append("za");
- break;
- case '?':
- if (ch2 == '?' && ch3 == '?') {
- builder.append("j?");
- i += 2;
- } else if (ch2 == '?' && ch3 == '?') {
- builder.append("j?");
- i += 2;
- } else if (ch2 == '?') {
- builder.append("ja");
- i++;
- } else if (ch2 == '?') {
- builder.append("jo");
- i++;
- } else if (ch2 == '?') {
- builder.append("ju");
- i++;
- } else if (ch2 == '?') {
- builder.append("je");
- i++;
- } else {
- builder.append("ji");
- }
- break;
- case '?':
- if (ch2 == '?') {
- builder.append("zi");
- i++;
- } else {
- builder.append("zu");
- }
- break;
- case '?':
- builder.append("ze");
- break;
- case '?':
- if (ch2 == '?') {
- builder.append("z?");
- i++;
- } else {
- builder.append("zo");
- }
- break;
- case '?':
- builder.append("da");
- break;
- case '?':
- builder.append("ji");
- break;
- case '?':
- builder.append("zu");
- break;
- case '?':
- if (ch2 == '?') {
- builder.append("di");
- i++;
- } else if (ch2 == '?') {
- builder.append("dyu");
- i++;
- } else {
- builder.append("de");
- }
- break;
- case '?':
- if (ch2 == '?') {
- builder.append("d?");
- i++;
- } else if (ch2 == '?') {
- builder.append("du");
- i++;
- } else {
- builder.append("do");
- }
- break;
- case '?':
- builder.append("ba");
- break;
- case '?':
- if (ch2 == '?' && ch3 == '?') {
- builder.append("by?");
- i += 2;
- } else if (ch2 == '?' && ch3 == '?') {
- builder.append("by?");
- i += 2;
- } else if (ch2 == '?') {
- builder.append("bya");
- i++;
- } else if (ch2 == '?') {
- builder.append("byo");
- i++;
- } else if (ch2 == '?') {
- builder.append("byu");
- i++;
- } else if (ch2 == '?') {
- builder.append("bye");
- i++;
- } else {
- builder.append("bi");
- }
- break;
- case '?':
- builder.append("bu");
- break;
- case '?':
- builder.append("be");
- break;
- case '?':
- if (ch2 == '?') {
- builder.append("b?");
- i++;
- } else {
- builder.append("bo");
- }
- break;
- case '?':
- builder.append("pa");
- break;
- case '?':
- if (ch2 == '?' && ch3 == '?') {
- builder.append("py?");
- i += 2;
- } else if (ch2 == '?' && ch3 == '?') {
- builder.append("py?");
- i += 2;
- } else if (ch2 == '?') {
- builder.append("pya");
- i++;
- } else if (ch2 == '?') {
- builder.append("pyo");
- i++;
- } else if (ch2 == '?') {
- builder.append("pyu");
- i++;
- } else if (ch2 == '?') {
- builder.append("pye");
- i++;
- } else {
- builder.append("pi");
- }
- break;
- case '?':
- builder.append("pu");
- break;
- case '?':
- builder.append("pe");
- break;
- case '?':
- if (ch2 == '?') {
- builder.append("p?");
- i++;
- } else {
- builder.append("po");
- }
- break;
- case '?':
- if (ch2 == '?' && ch3 == '?') {
- builder.append("vye");
- i+= 2;
- } else {
- builder.append('v');
- }
- break;
- case '?':
- builder.append('a');
- break;
- case '?':
- builder.append('i');
- break;
- case '?':
- builder.append('u');
- break;
- case '?':
- builder.append('e');
- break;
- case '?':
- builder.append('o');
- break;
- case '?':
- builder.append("wa");
- break;
- case '?':
- builder.append("ya");
- break;
- case '?':
- builder.append("yu");
- break;
- case '?':
- builder.append("yo");
- break;
- case '?':
- break;
- default:
- builder.append(ch);
- }
- }
- }
- }