Merged cenas com hugo
This commit is contained in:
parent
ea80d57ef9
commit
aafef78100
26
polymani.pl
26
polymani.pl
@ -155,11 +155,25 @@ is_number_in_predicate(C, F) :-
|
|||||||
/*******************************
|
/*******************************
|
||||||
* NLP *
|
* NLP *
|
||||||
*******************************/
|
*******************************/
|
||||||
|
|
||||||
|
/* DCG */
|
||||||
|
separator --> ["and"].
|
||||||
|
separator --> ["by"].
|
||||||
|
|
||||||
|
command --> ["show"].
|
||||||
|
command --> ["multiply"].
|
||||||
|
command --> ["simplify"].
|
||||||
|
command --> ["add"].
|
||||||
|
command --> ["forget"].
|
||||||
|
expression(A,B,C):-writeln("oi"),writeln(A),writeln(B),writeln(C),writeln("bye").
|
||||||
|
instruction(Left_expr, Right_expr) --> command, expression(Left_expr), separator, expression(Right_expr).
|
||||||
|
|
||||||
polyplay :-
|
polyplay :-
|
||||||
write("> "),
|
write("> "),
|
||||||
read(R),
|
read_line_to_codes(user_input, R),
|
||||||
(
|
(
|
||||||
R = bye,
|
writeln(R),
|
||||||
|
R = "bye",
|
||||||
write("See ya")
|
write("See ya")
|
||||||
;
|
;
|
||||||
(
|
(
|
||||||
@ -172,9 +186,10 @@ polyplay :-
|
|||||||
polyplay
|
polyplay
|
||||||
).
|
).
|
||||||
|
|
||||||
nlp_understand(R,P,I) :-
|
nlp_understand(R, P, I) :-
|
||||||
|
split_string(R, "\n", "\r\t ", RL),
|
||||||
(
|
(
|
||||||
R = simplify_x_squared,
|
RL = "simplify x squared",
|
||||||
P = simplify,
|
P = simplify,
|
||||||
I = x^2
|
I = x^2
|
||||||
;
|
;
|
||||||
@ -307,9 +322,6 @@ parse_expression(TL, TL-TR) --> parse_number(void, TR), { TR \= void, TL \= void
|
|||||||
%% ?- parse_expression(T, [two, times, times, two], _).
|
%% ?- parse_expression(T, [two, times, times, two], _).
|
||||||
%@ false.
|
%@ false.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*******************************
|
/*******************************
|
||||||
* BACKEND *
|
* BACKEND *
|
||||||
*******************************/
|
*******************************/
|
||||||
|
Reference in New Issue
Block a user