我的程序在swi prolog上运行良好,但是当我尝试使用gnu-prolog运行它时。它无法成功运行。我收到这个错误,我不知道如何解决。
这是我的第一个错误
gprolog [myprojectname]
?- ran the program calling the function
uncaught exception: error(existence_error(procedure,writeln/1),comp/0)
我在一行中运行了它
我试图在终端上以不同方式运行它 gplc [myprojectname]
gplc [myprojectname]
Undefined symbols for architecture x86_64:
"predicate(writeln/1)", referenced from:
predicate(comp/2) in gplcML9Z1g.o
_Lpred2_1 in gplcML9Z1g.o
_Lpred2_2 in gplcML9Z1g.o
_Lpred2_3 in gplcML9Z1g.o
_Lpred2_4 in gplcML9Z1g.o
ld:找不到体系结构x86_64的符号 clang:错误:链接器命令失败,退出代码为1(使用-v查看调用) 编译失败
答案 0 :(得分:0)
from bs4 import BeautifulSoup
import requests
def get_definition(word):
page = requests.get('https://www.dictionary.com/browse/' + word)
src = page.content
soup = BeautifulSoup(src, 'lxml')
mydivs = soup.findAll("meta", {"name": "description"})
definition_string = mydivs[0]['content']
return definition_string
print(get_definition("lol"))
Lol definition, laughing out loud; laugh out loud: used as a response to something funny or as a follow-up to something said only as a joke. See more.
谓词不是标准谓词,GNU Prolog不支持该谓词。将其替换为标准谓词writeln/1
和write/1
的组合。