Just another update
This commit is contained in:
parent
a25938f123
commit
00a190b0a6
6591 changed files with 94363 additions and 23227 deletions
9
Task/Tokenize-a-string/Prolog/tokenize-a-string-1.pro
Normal file
9
Task/Tokenize-a-string/Prolog/tokenize-a-string-1.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