13 lines
330 B
Python
13 lines
330 B
Python
import re
|
|
|
|
class NaturalLanguageGeneration:
|
|
|
|
def nlg(self, system_act):
|
|
response = None
|
|
pattern = r'inform\(name=([^\)]+)\)'
|
|
matching = re.search(pattern, system_act)
|
|
if matching:
|
|
name = matching.group(1)
|
|
response = f"Witaj, nazywam się {name}"
|
|
return response
|