修正
このコミットが含まれているのは:
+2
-3
@@ -8,14 +8,13 @@ class CommonModule:
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def len_by_full (cls, string: str) -> float:
|
def len_by_full (cls, string: str) -> float:
|
||||||
return sum ([1 if cls.is_wide (c) else .5
|
return sum ([1 if cls.is_wide (c) else .5 for c in string])
|
||||||
for c in string.decode ('utf-8')])
|
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def index_by_f2c (cls, string: str, index: float) -> int:
|
def index_by_f2c (cls, string: str, index: float) -> int:
|
||||||
i = 0
|
i = 0
|
||||||
work = ''
|
work = ''
|
||||||
for c in string.decode ('utf-8'):
|
for c in string:
|
||||||
work += c
|
work += c
|
||||||
if cls.len_by_full (work) > index:
|
if cls.len_by_full (work) > index:
|
||||||
break
|
break
|
||||||
|
|||||||
新しい課題から参照
ユーザをブロックする