Re: how to write an interactive crm program?
Ger Hobbelt <[email protected]>
| Newsgroups | gmane.mail.spam.crm114 |
|---|---|
| Message-ID | <[email protected]> |
Just a quick blurb before I go and rediscover the niceties of a bed at around 1 AM: since you use syscall, there's no requirement to have the syscall-ed item be another crm invocation: make that a syscall ... /sh interact.sh/ so you can write all of your interactive exchange in UNIX shell script (of course, this assumes you're on UNIX; for Windows, it would be something different: batch file with a bit of tools or something else entirely). Anyway, the idea is you don't need to write the interactive bit in crm script. On Sat, Jan 31, 2009 at 10:52 PM, Thomas Michael Hagen <[email protected]> wrote: > i'm using crm114 to topically classify articles from a newspaper corpus > gathered from the web over the past 10 years. > > the articles live in large files that contain all the material from several > different newspapers for a single day. > > my crm program goes through the file, finds each article, and classifies it. > up to this point, everything works. > > this is where my problem comes in: i'm trying to make the process > interactive, so that i can tell the program whether it classified each > article correctly. to do that, i have written the following function (please > excuse gmail's lack of indentation): > > :interact: { > { > isolate (:user-feedback:) > syscall () (:user-feedback:) /crm interact.crm/ > match (:incorrect:) [:user-feedback:] /w/ # 'w' for wrong > output /The piece was NOT classified correctly; you input > ':*:incorrect:'\n/ > # here is where the DSTTTR stuff will eventually go > return > } > output /The piece was classified correctly\n/ > return > } > > the syscall calls the following crm program: > > { > isolate (:user-input:) > output /:*:user-input:/ > } > > i have tried various variations over this, but i haven't been able to get > anything back from the interact.crm program, since it doesn't stop and wait > for my input to populate the variable (:user-input:). this leads to the > interact function in the main program matching on an empty string - the > (:user-feedback:) variable. > > the main program runs only when it gets an EOF, as it should, but the > interact.crm program doesn't seem to require an EOF. i was hoping it would > stop to wait for my input from the terminal (ended by an EOF) before it > continued. > > i haven't been able to find anything on interactivity or user input from the > terminal in the documentation. crm seems very mail-oriented. > ------------------------------------------------------------------------------ > This SF.net email is sponsored by: > SourcForge Community > SourceForge wants to tell your story. > http://p.sf.net/sfu/sf-spreadtheword > _______________________________________________ > Crm114-general mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/crm114-general > > -- Met vriendelijke groeten / Best regards, Ger Hobbelt -------------------------------------------------- web: http://www.hobbelt.com/ http://www.hebbut.net/ mail: [email protected] mobile: +31-6-11 120 978 -------------------------------------------------- ------------------------------------------------------------------------------ This SF.net email is sponsored by: SourcForge Community SourceForge wants to tell your story. http://p.sf.net/sfu/sf-spreadtheword