Browse Source

修正

btc-sounds
みてるぞ 9 months ago
parent
commit
69c5fef3ae
1 changed files with 2 additions and 3 deletions
  1. +2
    -3
      common_module.py

+ 2
- 3
common_module.py View File

@@ -8,14 +8,13 @@ class CommonModule:

@classmethod
def len_by_full (cls, string: str) -> float:
return sum ([1 if cls.is_wide (c) else .5
for c in string.decode ('utf-8')])
return sum ([1 if cls.is_wide (c) else .5 for c in string])

@classmethod
def index_by_f2c (cls, string: str, index: float) -> int:
i = 0
work = ''
for c in string.decode ('utf-8'):
for c in string:
work += c
if cls.len_by_full (work) > index:
break


Loading…
Cancel
Save