我必须在文件中搜索一个字符串,如果该术语存在,我就断言一个事实。
例如
我的文件:
title"Fast and furious"
year"2013"
actor"Vin Diesel"
assert(title(Fast and furious)),
assert(year(2013)),
assert(actor(Vin Diesel)).
我能怎么做?
编辑:
是否可以提取字符串的一部分?
<title>Fast and Furious</title>
我只会得到“速度与激情”,然后我会断言(标题(速度与激情))。有可能吗?我不使用 swi_prolog 的库(sgml)。