File size: 407 Bytes
87337b1 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
import time
def get_micro_ts():
return int(time.time() * 1_000_000)
def is_punctuation(char: str):
return char in [",", ",", ".", "。", "?", "?", "!", "!"]
def parse_sentence(sentence: str, content: str):
for i, char in enumerate(content):
sentence += char
if is_punctuation(char):
return sentence, content[i + 1:], True
return sentence, "", False
|