1

我得到了这个例外

Exception in thread "main" alice.tuprolog.InvalidTheoryException: The term part is not ended with a period.
    at alice.tuprolog.TheoryManager.consult(Unknown Source)
    at alice.tuprolog.Prolog.addTheory(Unknown Source)
    at alice.tuprolog.Prolog.setTheory(Unknown Source)
    at javaapplication9.Main.main(Main.java:32)

Java 结果:1

我可以从这个异常中了解到,输入 prolog 文件中有一些问题,这是我的输入文件,请告诉 mw 如何解决这个问题

noun('doctor_investigation_system_(DIS)').
noun('hospital_information_system_(HIS)').
noun('patients,_doctors,_nurses,_diseases,').
verb('have').
noun('unique_hospital_number').
noun('first_name,').
noun('last_name,').
noun('group,_e.g.,_government_officers,_social_security_group,_etc.)').
noun('privilege_types_(rights').
noun('particular_person').
verb('register').
noun('first_visit').
noun('multiple_privilege_types,').
verb('choose').
noun('first_priority').
noun('privilege_type').
verb('define').
noun('secondary_hospital,').
noun('registration_place,').
noun('expired_date').
noun('patient’s_information').
noun('first_name').
noun('last_name').
verb('see').
noun('patient’s_height,_weight,_blood_pressure,').
verb('finish').
verb('investigate').
verb('write').
noun('patient’s_diseases').
noun('unique_code').
noun('generic_name,').
noun('scientific_name').
noun('multiple_generic_names').
verb('allow').
noun('disease’s_information').
verb('consult').
noun('other_doctors').
verb('maintain').
verb('keep').
noun('different_medicines').
noun('different_prices').
verb('make').
noun('specific_time').
noun('identification_number').
cop('part of', 'be').
dep('doctor within_investigation_system_(DIS)', 'part of').
prep('part of', 'hospital_information_system_(HIS)').
nsubj('manipulates', 'DIS').
dobj('manipulates', 'datum about').
prep('datum about', 'patient ats,_doctor withins,_nurses,_diseases,').
prep('datum about', 'medicine').
conj_and('patient ats,_doctor withins,_nurses,_diseases,', 'medicine').
nsubj('have', 'patient at').
dobj('have', 'unique_hospital_number').
part ofmod('unique_hospital_number', '(hn),').
dobj('(hn),', 'first_name of,').
nsubj('reserved by', 'last_name of,').
nsubj('group,_e.g.,_government_officers,_social_security_group,_etc.)', 'last_name of,').
conj_and('last_name of,', 'privilege_types_(rights').
nsubj('reserved by', 'privilege_types_(rights').
dep('have', 'reserved by').
prep('reserved by', 'part oficular_person').
dep('have', 'group,_e.g.,_government_officers,_social_security_group,_etc.)').
conj_or('reserved by', 'group,_e.g.,_government_officers,_social_security_group,_etc.)').
nsubj('register on', 'patient at').
prep('register on', 'date of').
prep('date of', 'first_visit').
prep('date of', 'patient at').
conj_and('first_visit', 'patient at').
nsubj('record by', 'profile').
cop('record by', 'be').
dep('register on', 'record by').
prep('record by', 'officer').
nsubj('have', 'patient at').
dobj('have', 'multiple_privilege_types,').
prep('one of', 'multiple_privilege_types,').
nsubj('choose as', 'one of').
rcmod('multiple_privilege_types,', 'choose as').
prep('choose as', 'first_priority').
nsubj('define', 'privilege_type').
amod('hospital,', 'primary').
dobj('define', 'hospital,').
prep('define', 'secondary_hospital,').
dep('secondary_hospital,', 'registration_place,').
dep('secondary_hospital,', 'expired_date of').
conj_and('registration_place,', 'expired_date of').
nsubj('search', 'nurse').
dobj('search', 'patient at’s_information').
prepc_by('search', 'use').
nsubj('first_name of', 'HN,').
xcomp('use', 'first_name of').
xcomp('use', 'last_name of').
conj_or('first_name of', 'last_name of').
nsubj('see', 'patient at').
dobj('see', 'doctor within,').
dobj('need', 'doctor within,').
nsubj('need', 'nurse').
xsubj('record by', 'nurse').
rcmod('doctor within,', 'need').
xcomp('need', 'record by').
dobj('record by', 'patient at’s_height,_weight,_blood_pressure,').
dobj('record by', 'symptom').
conj_and('patient at’s_height,_weight,_blood_pressure,', 'symptom').
nsubj('finish', 'doctor within').
xcomp('finish', 'investigate').
dobj('investigate', 'patient at,').
dobj('have', 'patient at,').
nsubj('have', 'doctor within').
xsubj('write', 'doctor within').
rcmod('patient at,', 'have').
xcomp('have', 'write').
dobj('write', 'patient at’s_diseases').
nsubj('have', 'disease').
amod('“icd', 'unique_code').
dep('unique_code', '(called').
dobj('have', '“icd').
amod('“icd', 'generic_name of,').
amod('“icd', 'scientific_name of').
conj_and('generic_name of,', 'scientific_name of').
num('disease', 'One').
nsubj('have', 'disease').
dobj('have', 'multiple_generic_name ofs').
num('scientific_name of', 'one of').
dobj('have', 'scientific_name of').
conj_only('multiple_generic_name ofs', 'scientific_name of').
nsubj('allow', 'system').
dobj('allow', 'officer').
infmod('officer', 'print by').
dobj('print by', 'disease’s_information').
prep('print by', 'use').
dep('use', 'code').
nsubj('consult with', 'doctor within').
prep('consult with', 'other_doctor withins about').
prep('other_doctor withins about', 'patient at').
nsubj('case,', 'that').
cop('case,', 'be').
dobj('have', 'case,').
nsubj('have', 'name of').
prep('name of', 'doctor within').
prep('name of', 'name of').
conj_and('doctor within', 'name of').
prep('name of', 'consult withant').
rcmod('case,', 'have').
xcomp('have', 'maintain').
nsubj('be', 'name of').
prep('name of', 'doctor within').
ccomp('otherwise,', 'be').
ccomp('be', 'keep').
nsubj('order', 'doctor within').
nsubj('have', 'medicine').
conj_and('medicine', 'different_medicines').
nsubj('have', 'different_medicines').
ccomp('order', 'have').
dobj('have', 'different_prices').
nsubj('make with', 'doctor within').
dobj('make with', 'appointment').
prep('make with', 'patient at').
cop('more', 'be').
dep('there', 'more').
num('doctor within', 'one of').
nsubj('make with', 'doctor within').
prep('doctor within', 'clinic').
prep('doctor within', 'doctor within').
conj_and('clinic', 'doctor within').
dobj('make with', 'appointment').
num('patient at', 'one of').
prep('make with', 'patient at').
prep('patient at', 'specific_time').
nsubj('have', 'list of').
xsubj('maintain', 'list of').
prep('list of', 'clinic').
xcomp('have', 'maintain').
xcomp('have', 'clinic').
conj_and('maintain', 'clinic').
cop('subdivision of', 'be').
xcomp('have', 'subdivision of').
conj_and('maintain', 'subdivision of').
prep('subdivision of', 'depart ofment').
conj_and('doctor within', 'nurse').
cop('staff', 'be').
dep('doctor within', 'staff').
nsubj('have', 'nurse').
conj_and('nurse', 'doctor within').
nsubj('have', 'doctor within').
dobj('have', 'identification_number').
part ofmod('identification_number', '(id),').
nsubj('last_name of,', 'first_name of,').
xcomp('(id),', 'last_name of,').
xcomp('(id),', 'address').
conj_and('last_name of,', 'address').
nsubj('need', 'we').
xsubj('keep', 'we').
xcomp('need', 'keep').
dobj('keep', 'clinic').
nsubj('work', 'doctor within').
cop('work', 'be').
rcmod('clinic', 'work').

编辑

例外线和位置

Exception line : -1 Position: -1
4

1 回答 1

0

错误来自以下行:

mod的一部分('unique_hospital_number','(hn),')。

它预计在“部分”之后有一段时间。我对 tuprolog 或语法知之甚少,无法确切知道问题所在。“术语部分不以句号结尾。” 这意味着术语“部分”不以句点结尾。

至少你知道现在该往哪里看。

于 2010-09-23T13:56:49.227 回答