String manipulation in Prolog
From: basi (basiibarra_at_yahoo.com)
Date: 03/30/05
- Previous message: basi: "Re: Newbie: From Sentences to Grammar"
- Next in thread: djame: "Re: String manipulation in Prolog"
- Reply: djame: "Re: String manipulation in Prolog"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 29 Mar 2005 15:40:47 -0800
I'm exploring the use of Prolog in text/corpus processing. What is so
simple in other languages like Python and Ruby, I find so difficult to
do in Prolog. I have gone through the familiar family tree tutorial,
gone through Learning Prolog Now (excellent beginner book). But I
can't find much in the way of string manipulation. How do I do such
simple tasks like:
create a string variable, assign a value to it
search a string for a substring
concatenate strings
insert a substring into a string
compare two strings for (in)equality
iterate through a string
use control structures like if-then, repeat, while
and other string manipulation tasks, reverse, length, substringing
I realize that Prolog's syntax, and way of doing things, is different
from other languages. But the above are tasks that a text/corpus
programmer will do even in Prolog. If I can do familiar tasks like the
above in Prolog, then this would be a better Getting Started (for me)
than querying and extending a family tree database (which I have no
problem with). I don't mind direct translations of imperative commands
to declarations for now. I'll learn the idiom as I go along.
Which Prolog has the best string manipulation facility? I'm playing
with SWI-Prolog, but there isn't much there. Quintus appears to have
what I'm looking for but the product appears to be in limbo after
being acquired by SICStus (I'm also having problem installing it).
Thanks for your help.
basi
- Previous message: basi: "Re: Newbie: From Sentences to Grammar"
- Next in thread: djame: "Re: String manipulation in Prolog"
- Reply: djame: "Re: String manipulation in Prolog"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|