File size: 323 Bytes
16959be
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
import re


def question_to_statement(question: str):
    pattern = "(?P<qWord>kapan|(ber|meng|si)?apa|(di|ke) ?(mana)|bagaimana) ?(saja)? ?(kah)?"

    result = re.sub(pattern, "", question.lower())
    result = result.replace("?", "")
    result = re.sub("\s+", " ", result)
    result = result.strip()
    return result