Sir, I use swi-prolog 5.6 to call class java . My problems are
1. I must convert list of lists of lists to atom or string ,but there are errors as ;
atom_codes(Pa,Parses), Parses = list of lists of lists
ERROR: (c:/thesis/gfulab/load.pl:4):
atom_chars/2: Type error: `text' expected, found `[[[wordtype=NOUN, head=nectec, sem=[pred=NECTEC, ntype=NPRP, ontology=enterprise]]]]'
Warning: (c:/thesis/gfulab/load.pl:4):
Goal (directive) failed: user:main
atom_codes(Pa,Parses), Parses = list of lists of lists
ERROR: (c:/thesis/gfulab/load.pl:4):
atom_codes/2: Type error: `text' expected, found `[[wordtype=NOUN, head= nectec, sem=[pred=NECTEC, ntype=NPRP, ontology=enterprise]]]'
Warning: (c:/thesis/gfulab/load.pl:4):
Goal (directive) failed: user:main
% c:/thesis/gfulab/load.pl compiled 1.02 sec, 826,976 bytes
string_to_list(Pa,P), P = list of lists of lists
string_to_atom(Pa,Parse),
ERROR: (c:/thesis/gfulab/load.pl:4):
string_to_list/2: Arguments are not sufficiently instantiated
Warning: (c:/thesis/gfulab/load.pl:4):
Goal (directive) failed: user:main
% c:/thesis/gfulab/load.pl compiled 1.00 sec, 1,008 bytes
prolog code as :
procr(show(cg=L)) :-
findall(M,recorded(matrix,M,_),Parses),!,
forall( member(P,Parses),
(write('==>'), pp_f_structure(synt,L,7,P) ) ),
findall(M,recorded(matrix,M,_),Parses),!,
forall( member(P,Parses),
(write('==>'),dmember(sem=S,P),!,pp_f_structure(sem,L,7,S) ) ),
string_to_list(Pa,Parses),
string_to_atom(Pa,Parse),
jpl_new('Cgraph',Parse,F),
jpl_call(F,startCg,[@(true)],@void).
java code as:
public static void main(String[] args)
{
String listStr;
Cgraph cg = new Cgraph(listStr);
cg.startCg();
} // end main