def format_one_size(size):
     size = jctconv.normalize(size.upper())
     if size == SIZE_S or size == "SMALL":
         return "Small"
     elif size == SIZE_M or size == "MEDIUM":
         return "Medium"
     elif size == SIZE_L or size == "LARGE":
         return "Large"
     elif size == SIZE_XL or size == "XLARGE":
         return "XLarge"
     else:
         return size
Example #2
0
 def format_size(size):
     global log
     size = jctconv.normalize(size.lower())
     if size == EMPTY:
         return "random_random"
     elif size == SIZE_S or size == SIZE_M or size == SIZE_L or size == SIZE_XL:
         return "shirtsother_{}".format(size)
     elif "/" in size:
         return None
     elif float(size) < 28:
         return "shoes_{}".format(size)
     else:
         return "pants_{}".format(size)
Example #3
0
def normalize(string):
    string = convert_expr(string)

    keep = Keep(expressions_keep)
    string = keep.encode(string)
    string = preprocess(string)
    string = convert_digit(string)
    string = jctconv.normalize(string, 'NFKC')
    string = jctconv.h2z(string, digit=True, ascii=True)
    string = convert_two_digit(string)
    string = keep.restore(string)

    return string
 def format_size(size):
     global log
     size = jctconv.normalize(size.upper())
     if size == SIZE_S:
         return "Small"
     elif size == SIZE_M:
         return "Medium"
     elif size == SIZE_L:
         return "Large"
     elif size == SIZE_XL:
         return "XLarge"
     else:
         return size
    def format_size(size):
        size = jctconv.normalize(size.lower())
        if size == EMPTY:
            return "random_random"
        elif size == SIZE_S or size == SIZE_M or size == SIZE_L or size == SIZE_XL:
            return "shirtsother_{}".format(size)
        elif "/" in size:
            return None
        else:
            size = float(size)
            if size % 1.0 == 0.0:
                size = int(size)

            if size < 28:
                return "shoes_{}".format(size)
            else:
                return "pants_{}".format(size)
Example #6
0
def test_normalize():
    assert_equal(jctconv.normalize('ティロ・フィナ〜レ', 'NFKC'), 'ティロ・フィナーレ')
    assert_equal(jctconv.normalize(_concat(HALF_KANA, FULL_DIGIT), 'NFKC'),
                 ''.join(FULL_KANA)+''.join(HALF_DIGIT))
Example #7
0
def test_normalize():
    assert_equal(jctconv.normalize(u'ティロ・フィナ〜レ', 'NFKC'), u'ティロ・フィナーレ')
    assert_equal(jctconv.normalize(HALF_KANA+FULL_DIGIT, 'NFKC'), FULL_KANA+HALF_DIGIT)