all tasks
This commit is contained in:
parent
b83f433714
commit
68f8f3e56b
14735 changed files with 178959 additions and 0 deletions
9
Task/Tokenize-a-string/Prolog/tokenize-a-string.pro
Normal file
9
Task/Tokenize-a-string/Prolog/tokenize-a-string.pro
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
splitup(Sep,[token(B)|BL]) --> splitup(Sep,B,BL).
|
||||
splitup(Sep,[A|AL],B) --> [A], {\+ [A] = Sep }, splitup(Sep,AL,B).
|
||||
splitup(Sep,[],[B|BL]) --> Sep, splitup(Sep,B,BL).
|
||||
splitup(_Sep,[],[]) --> [].
|
||||
start :-
|
||||
phrase(splitup(",",Tokens),"Hello,How,Are,You,Today"),
|
||||
phrase(splitup(".",Tokens),Backtogether),
|
||||
string_to_list(ABack,Backtogether),
|
||||
writeln(ABack).
|
||||
Loading…
Add table
Add a link
Reference in a new issue