* All hankaku Katanaka is converted into Zenkaku Katakana
    * All hankaku English alphabet and numberc string are converted into Zenkaku one
322543
def normalize_text_normal_ipadic(input_text, kana=True, ascii=True, digit=True):
    # type: (text_type,bool,bool,bool)->text_type
    
    return jaconv.h2z(input_text, kana=kana, ascii=ascii, digit=digit)
1322848
private boolean isIkkitsukan(List<Shuntsu> oneTypeShuntsuList) {
        //この3つが全てtrueになれば一気通貫
        boolean number2 = false;
        boolean number5 = false;
        boolean number8 = false;

        for (Shuntsu shuntsu : oneTypeShuntsuList) {
            int num = shuntsu.getTile().getNumber();
            if (num == 2) {
                number2 = true;
            } else if (num == 5) {
                number5 = true;
            } else if (num == 8) {
                number8 = true;
            }
        }
        return number2 && number5 && number8;
    }
708697
private JsonToken decodeNumber(char[] chars, int offset, int length) {
        int i = offset;
        int c = chars[i];

        if (c == '-') {
            c = chars[++i];
        }

        if (c == '0') {
            c = chars[++i];
        } else if (c >= '1' && c <= '9') {
            c = chars[++i];
            while (c >= '0' && c <= '9') {
                c = chars[++i];
            }
        } else {
            return JsonToken.STRING;
        }

        if (c == '.') {
            c = chars[++i];
            while (c >= '0' && c <= '9') {
                c = chars[++i];
            }
        }

        if (c == 'e' || c == 'E') {
            c = chars[++i];
            if (c == '+' || c == '-') {
                c = chars[++i];
            }
            if (c >= '0' && c <= '9') {
                c = chars[++i];
                while (c >= '0' && c <= '9') {
                    c = chars[++i];
                }
            } else {
                return JsonToken.STRING;
            }
        }

        if (i == offset + length) {
            return JsonToken.NUMBER;
        } else {
            return JsonToken.STRING;
        }
    }
315432
protected static function compileUnencodedCharacters()
    {
        foreach (static::$compositions as $composition) {
            $composition_characters = self::${$composition};

            $delta = array_diff($composition_characters, static::$unencoded_characters);

            if (!empty($delta)) {
                static::$unencoded_characters = array_merge(static::$unencoded_characters, self::${$composition});
            }
        }
    }
946083
private void init(List<Mentsu> winCandidate, Toitsu toitsu) {
        // 操作変数を初期化
        initStock();
        winCandidate.clear();
        //ストックから雀頭を減らす
        handStocks[toitsu.getTile().getCode()] -= 2;
        winCandidate.add(toitsu);
    }
1324230
protected void init() {
        
        if(isZero()) {
            this.integerPart = "";
            this.decimalPart = "";
            return;
        }
        
        final StringBuilder sb = new StringBuilder();
        sb.append("#");
        if(scale > 0) {
            sb.append(".");
        }
        
        // 小数の精度分、書式を追加する。
        for(int i=0; i < scale; i++) {
            sb.append("#");
        }
        
        final DecimalFormat format = new DecimalFormat(sb.toString());
        format.setRoundingMode(RoundingMode.HALF_UP);
        
        double num = Math.abs(getValue());
        if(getPermilles() > 0) {
            num /= Math.pow(1000, getPermilles());
        }
        
        String str = format.format(num);
        
        // 数値を小数部と整数部に分割する。
        setupIntegerAndDecimalPart(str);
        
    }
12372
function(g,g2,x1,y1,x2,y2){
		// source側はtaranslateのぶん足されていないので、加算しておきます
		var sx1 = this.x0+x1*this.bw-1, sy1 = this.y0+y1*this.bh-1,
			sx2 = this.x0+x2*this.bw+2, sy2 = this.y0+y2*this.bh+2;
		if(sx1<0){ sx1=0;} if(sx2>g2.child.width) { sx2=g2.child.width;}
		if(sy1<0){ sy1=0;} if(sy2>g2.child.height){ sy2=g2.child.height;}
		g.drawImage(g2.child, sx1, sy1, (sx2-sx1), (sy2-sy1), sx1-this.x0, sy1-this.y0, (sx2-sx1), (sy2-sy1));
	}
479463
public com.google.protobuf.ByteString getCharactersToSkipBytes() {
    java.lang.Object ref = "";
    if (charactersCase_ == 1) {
      ref = characters_;
    }
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      if (charactersCase_ == 1) {
        characters_ = b;
      }
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }
94586
protected void createEncoding() {
        if (encoding.startsWith("#")) {
            specialMap = new IntHashtable();
            StringTokenizer tok = new StringTokenizer(encoding.substring(1), " ,\t\n\r\f");
            if (tok.nextToken().equals("full")) {
                while (tok.hasMoreTokens()) {
                    String order = tok.nextToken();
                    String name = tok.nextToken();
                    char uni = (char)Integer.parseInt(tok.nextToken(), 16);
                    int orderK;
                    if (order.startsWith("'"))
                        orderK = order.charAt(1);
                    else
                        orderK = Integer.parseInt(order);
                    orderK %= 256;
                    specialMap.put(uni, orderK);
                    differences[orderK] = name;
                    unicodeDifferences[orderK] = uni;
                    widths[orderK] = getRawWidth(uni, name);
                    charBBoxes[orderK] = getRawCharBBox(uni, name);
                }
            }
            else {
                int k = 0;
                if (tok.hasMoreTokens())
                    k = Integer.parseInt(tok.nextToken());
                while (tok.hasMoreTokens() && k < 256) {
                    String hex = tok.nextToken();
                    int uni = Integer.parseInt(hex, 16) % 0x10000;
                    String name = GlyphList.unicodeToName(uni);
                    if (name != null) {
                        specialMap.put(uni, k);
                        differences[k] = name;
                        unicodeDifferences[k] = (char)uni;
                        widths[k] = getRawWidth(uni, name);
                        charBBoxes[k] = getRawCharBBox(uni, name);
                        ++k;
                    }
                }
            }
            for (int k = 0; k < 256; ++k) {
                if (differences[k] == null) {
                    differences[k] = notdef;
                }
            }
        }
        else if (fontSpecific) {
            for (int k = 0; k < 256; ++k) {
                widths[k] = getRawWidth(k, null);
                charBBoxes[k] = getRawCharBBox(k, null);
            }
        }
        else {
            String s;
            String name;
            char c;
            byte b[] = new byte[1];
            for (int k = 0; k < 256; ++k) {
                b[0] = (byte)k;
                s = PdfEncodings.convertToString(b, encoding);
                if (s.length() > 0) {
                    c = s.charAt(0);
                }
                else {
                    c = '?';
                }
                name = GlyphList.unicodeToName(c);
                if (name == null)
                    name = notdef;
                differences[k] = name;
                unicodeDifferences[k] = c;
                widths[k] = getRawWidth(c, name);
                charBBoxes[k] = getRawCharBBox(c, name);
            }
        }
    }
844072
public static List<Pinyin> convert(String complexText, boolean removeTone)
    {
        List<Pinyin> pinyinList = convert(complexText);
        if (removeTone)
        {
            makeToneToTheSame(pinyinList);
        }
        return pinyinList;
    }
373459
protected void init() {

        // 読み込み用の登録
        registerForReading(conversionHandler);
        registerForReading(new ParseProcessorFactory<>());
        registerForReading(constraintHandler);

        // 書き込み用の登録
        registerForWriting(constraintHandler);
        registerForWriting(new PrintProcessorFactory<>());
        registerForWriting(conversionHandler);

        // 変換用の登録
        registerForConversion(CsvNullConvert.class, new NullConvertFactory());
        registerForConversion(CsvDefaultValue.class, new DefaultValueFactory());
        registerForConversion(CsvTrim.class, new TrimFactory());
        registerForConversion(CsvUpper.class, new UpperFactory());
        registerForConversion(CsvLower.class, new LowerFactory());
        registerForConversion(CsvRegexReplace.class, new RegexReplaceFactory());
        registerForConversion(CsvWordReplace.class, new WordReplaceFactory());
        registerForConversion(CsvFullChar.class, new FullCharFactory());
        registerForConversion(CsvHalfChar.class, new HalfCharFactory());
        registerForConversion(CsvLeftPad.class, new LeftPadFactory());
        registerForConversion(CsvRightPad.class, new RightPadFactory());
        registerForConversion(CsvMultiPad.class, new MultiPadFactory());
        registerForConversion(CsvOneSideTrim.class, new OneSideTrimFactory());

        // 制約用の登録
        registerForConstraint(CsvRequire.class, new RequireFactory());
        registerForConstraint(CsvUnique.class, new UniqueFactory<>());
        registerForConstraint(CsvUniqueHashCode.class, new UniqueHashCodeFactory<>());
        registerForConstraint(CsvEquals.class, new EqualsFactory<>());

    }
455076
public function isKanji(string $string):bool{
		$i   = 0;
		$len = \strlen($string);

		while($i + 1 < $len){
			$c = ((0xff&\ord($string[$i])) << 8)|(0xff&\ord($string[$i + 1]));

			if(!($c >= 0x8140 && $c <= 0x9FFC) && !($c >= 0xE040 && $c <= 0xEBBF)){
				return false;
			}

			$i += 2;
		}

		return $i >= $len;
	}
1023905
private static int getChsAscii(String chs) {
		int asc = 0;
		byte[] bytes = chs.getBytes(CharsetUtil.CHARSET_GBK);
		switch (bytes.length) {
		case 1:
			// 英文字符
			asc = bytes[0];
			break;
		case 2:
			// 中文字符
			int hightByte = 256 + bytes[0];
			int lowByte = 256 + bytes[1];
			asc = (256 * hightByte + lowByte) - 256 * 256;
			break;
		default:
			throw new UtilException("Illegal resource string");
		}
		return asc;
	}
294197
private static String canonicalize(String s) {

        int length = s.length();
        StringBuffer result = new StringBuffer(length);

        // The first character must be '/'.  Append it to the result, and then
        // skip the first character in the input string.
        result.append('/');

        for (int i = 1; i < length; i++) {
            char ch = s.charAt(i);

            if (ch != '.' || result.charAt(result.length() - 1) != '/') {
                // A character other than '.', or we're not at the beginning of
                // a path segment.
                result.append(ch);
            } else if (i + 1 == length || s.charAt(i + 1) == '/') {
                // We have a "." path segment.  Skip the following "/".
                i++;
            } else if (s.charAt(i + 1) == '.' && (i + 2 == length || s.charAt(i + 2) == '/')) {
                // We have a ".." path segment.  Skip the following "./".
                i += 2;

                int j = result.length();
                if (--j > 0) {
                    // Walk backwards until we find a '/'.
                    while (result.charAt(j - 1) != '/' && --j > 0);

                    result.setLength(j);
                }
            } else {
                // Found a path segment that starts with a '.' that is not "."
                // or "..".
                result.append('.');
            }
        }
        return result.toString();
    }
379789
def h2e(string):
    
    result = []
    for c in string:
        ccode = ord(c)  # Character code

        if 0x3131 <= ccode <= 0x3163:  # Hangul Compatibility Jamo
            result.append(H2E_MAPPING[c])
        elif 0xAC00 <= ccode <= 0xD7A3:  # Hangul Syllables
            ccode -= 0xAC00
            # decompose hangul
            lead = JA_LEAD[ccode // 588]
            medi = MO[(ccode % 588) // 28]
            tail = JA_TAIL[(ccode % 588) % 28]
            result.append(H2E_MAPPING[lead])
            result.append(H2E_MAPPING[medi])
            result.append(H2E_MAPPING[tail])
        else:  # Rest of all characters
            result.append(c)
    return ''.join(result)
1213293
public static String toCanonicalForm(CharSequence input) {
      if (input == null) {
         return null;
      }
      return StringFunctions.CANONICAL_NORMALIZATION.apply(input.toString());
   }
874988
@Override
	public String toCanonicalString() {
		String result;
		if(hasNoStringCache() || (result = getStringCache().canonicalString) == null) {
			getStringCache().canonicalString = result = toNormalizedString(MACStringCache.canonicalParams);
		}
		return result;
	}