I want to perform some operation like string search, iterate, split etc on sentence. I checked couple of Prolog tuts but no help - http://kti.ms.mff.cuni.cz/~bartak/prolog/contents.html, http://www.bitwisemag.com/copy/programming/prolog/intro/firststeps.html. I wanted to write program like this :
for linking in post_script_link_list:
sub_link = re.search('\((.*?)\)',linking).group(1)
if sub_link in links_list1:
if ('Who').lower() in sent_split or 'Who' in sent_split:
result = 'person'
break
elif (('Where').lower() in sent_split or 'Where' in sent_split) and 'What' not in read_str and 'what' not in read_str:
result = 'location'
break
elif ('Why').lower() in sent_split or 'Why' in sent_split:
result = 'reason'
break
elif ('How many').lower() in read_str or 'How many' in read_str:
result = 'count'
break
elif (('When').lower() in sent_split or 'When' in sent_split) and 'What' not in read_str and 'what' not in read_str:
result = 'time'
break
elif (('How').lower() in sent_split or 'How' in sent_split) and ('How long').lower() not in read_str and 'How long' not in read_str and ('How much').lower() not in read_str and 'How much' not in read_str:
result = 'manner'
break
elif sub_link in links_list2:
check_yn = verify_yesno(post_script_link_list)
if check_yn == 1:
result = 'Yes/No'
break
elif check_yn == 0:
result = 'Not found'
break
break
else:
result = 'Not found'
is it possible to perform usnig prolog? I am using pyswip and python
UPDATE
1 ?- split_string("a.b.c.d", ".", "", L).
ERROR: toplevel: Undefined procedure: split_string/4 (DWIM could not correct goal)