Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

convert list of list of list to atom or string in swi-prolog

Status
Not open for further replies.

tawee

Programmer
Jul 29, 2008
1
TH
Hi, I use swi-prolog and want to convert list of list of list to atom or string . I am new Prolog.
my code as:

Parses = `[[[wordtype=NOUN, head=nectec, sem=[pred=NECTEC, ntype=NPRP, ontology=enterprise]]]]'

atom_codes(Pa,Parses), Parses = list of lists of lists

ERROR: (c :/gfulab/load.pl:4):
atom_chars/2: Type error: `text' expected, found `[[[wordtype=NOUN, head=nectec, sem=[pred=NECTEC, ntype=NPRP, ontology=enterprise]]]]'


atom_codes(Pa,Parses), Parses = list of lists of lists


ERROR: (c:/ gfulab/load.pl:4):
atom_codes/2: Type error: `text' expected, found `[[wordtype=NOUN, head= nectec, sem=[pred=NECTEC, ntype=NPRP, ontology=enterprise]]]'


string_to_list(Pa,P), P = list of lists of lists
string_to_atom(Pa,Parse),

ERROR: (c: /gfulab/load.pl:4):
string_to_list/2: Arguments are not sufficiently instantiated


Sir, I have a question about Prolog.
I am new Prolog that I want to convert list of list of list to atom as follow:

Parses = `[[[wordtype=NOUN, head=nectec, sem=[pred=NECTEC, ntype=NPRP, ontology=enterprise]]]]'

atom_codes(Pa,Parses), Parses = list of lists of lists

ERROR: (c :/gfulab/load.pl:4):
atom_chars/2: Type error: `text' expected, found `[[[wordtype=NOUN, head=nectec, sem=[pred=NECTEC, ntype=NPRP, ontology=enterprise]]]]'


atom_codes(Pa,Parses), Parses = list of lists of lists


ERROR: (c:/ gfulab/load.pl:4):
atom_codes/2: Type error: `text' expected, found `[[wordtype=NOUN, head= nectec, sem=[pred=NECTEC, ntype=NPRP, ontology=enterprise]]]'


string_to_list(Pa,P), P = list of lists of lists
string_to_atom(Pa,Parse),

ERROR: (c: /gfulab/load.pl:4):
string_to_list/2: Arguments are not sufficiently instantiated

Please advise me.
Thank you very much
Tawee
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top