Update NaturalLanguageGeneration.py
This commit is contained in:
parent
5d77dc0914
commit
a2a83332e4
@ -1,8 +1,12 @@
|
||||
import re
|
||||
|
||||
class NaturalLanguageGeneration:
|
||||
|
||||
def nlg(self, system_act):
|
||||
response = None
|
||||
name = "James"
|
||||
if system_act == f"inform(name={name})":
|
||||
pattern = r'inform\(name=([^\)]+)\)'
|
||||
matching = re.search(pattern, system_act)
|
||||
if matching:
|
||||
name = matching.group(1)
|
||||
response = f"Witaj, nazywam się {name}"
|
||||
return response
|
||||
|
Loading…
Reference in New Issue
Block a user