Con: find #CompoundWords
=?gb2312?q?ye=20juan?=
yejuan_1204 at yahoo.com.cn
Fri Dec 12 01:55:01 UTC 2003
Hi
Thanks for all of your replies. Maybe I have trouble
expressiong my thought, so I describe it in details.
I have once developed a system in visualworks 5i.4,
and now I want to convert the codes to Squeak. In
VW5i.4, I parse an expression
"Student.birthYear:=2003-Student.age", and two parts
are expected to return: 'Student.birthYear',
'Student.age' by calling a method ScanCompoundWords: ,
which I add to the class Scanner.
scanCompoundWords: stringOrArray
| strm |
(stringOrArray isMemberOf: Array)
ifTrue: [^stringOrArray].
stringOrArray isEmpty ifTrue: [^Array new: 0].
self scan: (ReadStream on: stringOrArray asString).
strm := WriteStream on: (Array new: 10).
[tokenType = #doIt]
whileFalse:
[(tokenType = #compoundWord
or: [tokenType = #word])
ifTrue: [strm nextPut: token].
self scanToken].
^strm contents.
In Squeak, however, calling the method returns four
parts:'Student', 'age', 'Student', 'birthYear'. It
seems as if that the tokenType #compoundWords can not
be recognized.
Please tell me how to solve the problem. Thanks again.
Lulu
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
More information about the Squeak-dev
mailing list
|