Spell Checker
[1/7] from: al:bri:xtra at: 19-Jan-2001 17:47
Spurred on by Reichart's comment [on Rebol/Ahem] about a Rebol Spell Checker
and Corrector being needed and needing one myself for my eText project
(plain text with human understandable formatting into HTML), I wrote up this
quick spell checker. Unfortunately, it doesn't work yet. I really need to
know what Rebol word I need to put in the "action" block for the buttons to
continue
or "exit" the "view layout" part. Also, what word is used to
retrieve the text from the 'Correction field? Does anyone know these?
Thank you for your help.
[
Rebol [
Name: 'Spell
Title: "Spell Checker and Corrector"
File: %Spell.r
Author: "Andrew Martin"
eMail: [Al--Bri--xtra--co--nz]
Date: 19/Jan/2001
]
Spell!: make object! [
Directory: %Spell/
if not exists? Directory [md Directory]
Dictionary: make block! 0
error? try [Dictionary: sort load Directory/Dictionary.txt]
Lower: charset [#"a" - #"z"]
Upper: charset [#"A" - #"Z"]
Alpha: union Upper Lower
set 'Spell function [Text [string!]][Word WordStart WordEnd][
parse/all Text [
some [
WordStart: [some Alpha opt [[{'} | {-}] some Alpha]]
WordEnd: (
Word: copy/part WordStart WordEnd
if not found? find Dictionary Word [
view layout [
h1 "Spell"
h2 "Miss-spelled word?"
across
text Word Add: button 200 "Add to Dictionary"
[append Dictionary Word] return
text "Correction: " Correction: field return
button "Cancel" button "OK" []
]
]
)
| skip
]
]
Text
]
]
Spell "hello"
]
Andrew Martin
ICQ: 26227169 http://members.nbci.com/AndrewMartin/
[2/7] from: arolls:bigpond:au at: 19-Jan-2001 17:46
view layout [
text "Correction: " Correction: field [print Correction/text]
button "Close" [unview/all]
]
Pressing enter or tabbing from the field causes
the field's action to happen.
Note that in your code, Cancel can't work unless you reach
into the Dictionary file and delete the word you just
added. Undo in the form of Cancel is cool, but I advise
get rid of OK and Cancel and just have Close.
Anton.
[3/7] from: reichart:prolific at: 18-Jan-2001 23:11
1. Q: Unfortunately, it doesn't work yet
A: I thought you were going to say…"because you misspelled something.
But, hey Cool!
You build the basic structure, I will go gather some PD dictionaries, and
convert them. We can then submit to Rebol as the keeper of the files.
While spelling is by in far my primary goal, Word Def (dictionary), and
Thesaurus are my secondary goals. So also, let me ask now that you make
the format easily upgrade-able to handle several fields:
Such as:
TYPE: Non, verb, etc.
ROOT: Where the word comes from.
PHONEME: Phonetic spelling.
MEANINGS: The different examples of the meaning of the word.
EXAMPLES: Example sentences using the word.
Then as things grow we can start looking at language to language
dictionaries.
The world is getting smaller everyday.
Reichart…
No man is an island…
[4/7] from: deryk:iitowns at: 19-Jan-2001 16:30
Reichart wrote:
> 1. Q: Unfortunately, it doesn't work yet
> A: I thought you were going to say?"because you misspelled something.
<<quoted lines omitted: 4>>
> Thesaurus are my secondary goals. So also, let me ask now that you make
> the format easily upgrade-able to handle several fields:
Looked at RFC2229?
Deryk
[5/7] from: jeff:rebol at: 19-Jan-2001 8:53
Howdy, Reichart:
> So also, let me ask now that you
> make the format easily upgrade-able to handle several
<<quoted lines omitted: 4>>
> examples of the meaning of the word. EXAMPLES: Example
> sentences using the word.
You can always just look up the above info on demand for
words using the dict:// protocol. You can find a REBOL
implementation of this protocol for at www.dict.org.
-jeff
[6/7] from: reichart::prolific::com at: 19-Jan-2001 12:37
1. Q: Looked at RFC2229?
A: Yes. Although it has been a while.
Jeff wrote Dict.r, which is the start.
There are two issues as I see it. Data and interface.
I figure between the Web community and Universities, the Data is pretty much
there.
So it is the UI that REALLY matters to me.
My hope is to put forth a design that becomes indigenous to Rebol Apps.
Where ever a User can enter next, it can be spell checked, etc.
Also, a simple method for giving feedback to the organizations who are the
keepers
of the databases would be important.
There is a Linux project for Internationalization, and Localization that is
pretty cool. Basically once we get Spell checking, and Dictionary working, I
want to look towards these projects as a way to make Rebol not just system
transient, but mulit-language friendly.
As Charley Chaplin used to say "My movies are for all people to laugh, not
just those that speak English."
Reichart…
No man is an island…
[7/7] from: al:bri:xtra at: 20-Jan-2001 11:25
Thank you Anton!
Andrew Martin
ICQ: 26227169 http://members.nbci.com/AndrewMartin/
Notes
- Quoted lines have been omitted from some messages.
View the message alone to see the lines that have been omitted