i have no idea about wordnet. plz help me how to connect to rita wordnet. plz and also some sample code
to retrieve from wordnet using standford or jwi or jwnl or rtita wordnet.
// PURPOSE: ALGORITHM FOR CLASSIFICATION OF WORDS USING JAVA
// AND WORDNET
// I/P: TEXT FILE CONSISTING OF NON REDUNDANT WORDS
// O/P: FILE CONSISTING OF CLASSIFIED WORDS ACCORDING TO THEIR POS
//Initialize RitaWordNet object
RitaWordnet wordnet = new RitaWordNet (null)
//read or open the file
If (! file) then
Throw an exception indicating an error has occurred and exit
Else
Open a file in read mode
Declare a buffer to read the file and do further operations
BEGIN
//Initialize flags F1, F2, F3, F4 to zero
F1<-0, F2<-0, F3<-0, F4 noun
v –> verb
a –> adjective
r –> adverb */
Set the flags according to the contents of string i.e.
Obtain the length of the string
for i<- 0 to (length-1)
// assign all flags to 0 ie F1<-0, F2<-0, F3<-0, F4<-0
If pos[i]=’a’ then
F1<-1
if pos[i]=’n’ then
F2<-1
if pos[i]=’r’ then
F3<-1
If pos[i]=’v’ then
F4<-1
END FOR
IF F1 = 1 AND F2 = 1 AND F3 = AND F4 = 1 then
WRITE the word onto column1 ANRV
Else
IF F1 = 1 AND F2 = 1 AND F3 = 1 then
WRITE the word onto column2 ANR
Else
IF F1 = 1 AND F2 = 1 AND F4 = 1 then
WRITE the word onto column3 ANV
Else
IF F1 = 1 AND F3 = 1 AND F4 = 1 then
WRITE the word onto column4 ARV
Else
IF F2 = 1 AND F3 = 1 AND F4 = 1 then
WRITE the word onto column5 NRV
Else
IF F1 = 1 AND F2 = 1 then
WRITE the word onto column6 AN
Else
IF F1 = 1 AND F3 = 1 then
WRITE the word onto column7 AR
Else
IF F1 = 1 AND F4 = 1 then
WRITE the word onto column8 AV
Else
IF F2 = 1 AND F3 = 1 then
WRITE the word onto column9 NR
Else
IF F2 = 1 AND F4 = 1 then
WRITE the word onto column10 NV
Else
IF F3 = 1 AND F4 = 1 then
WRITE the word onto column11 ANV
Else
IF F1 = 1 then
WRITE the word onto column12 A
Else
IF F2 = 1 then
WRITE the word onto column13 N
Else
IF F3 = 1 then
WRITE the word onto column 14 R
Else
IF F4 = 1 then
WRITE the word onto column15 V
Else
WRITE the word onto column16 OTHERS
END
/* This can also implemented using methods like isnoun(), isadverb(), isverb() & isadjective(). These methods return Boolean values.
Take each word from the file and then using these methods set the flag values. Depending on the flag values right onto the respective file */
i have no idea about wordnet. plz help me how to connect to rita wordnet. plz and also some sample code
to retrieve from wordnet using standford or jwi or jwnl or rtita wordnet.
// PURPOSE: ALGORITHM FOR CLASSIFICATION OF WORDS USING JAVA
// AND WORDNET
// I/P: TEXT FILE CONSISTING OF NON REDUNDANT WORDS
// O/P: FILE CONSISTING OF CLASSIFIED WORDS ACCORDING TO THEIR POS
//Initialize RitaWordNet object
RitaWordnet wordnet = new RitaWordNet (null)
//read or open the file
If (! file) then
Throw an exception indicating an error has occurred and exit
Else
Open a file in read mode
Declare a buffer to read the file and do further operations
BEGIN
//Initialize flags F1, F2, F3, F4 to zero
F1<-0, F2<-0, F3<-0, F4 noun
v –> verb
a –> adjective
r –> adverb */
Set the flags according to the contents of string i.e.
Obtain the length of the string
for i<- 0 to (length-1)
// assign all flags to 0 ie F1<-0, F2<-0, F3<-0, F4<-0
If pos[i]=’a’ then
F1<-1
if pos[i]=’n’ then
F2<-1
if pos[i]=’r’ then
F3<-1
If pos[i]=’v’ then
F4<-1
END FOR
IF F1 = 1 AND F2 = 1 AND F3 = AND F4 = 1 then
WRITE the word onto column1 ANRV
Else
IF F1 = 1 AND F2 = 1 AND F3 = 1 then
WRITE the word onto column2 ANR
Else
IF F1 = 1 AND F2 = 1 AND F4 = 1 then
WRITE the word onto column3 ANV
Else
IF F1 = 1 AND F3 = 1 AND F4 = 1 then
WRITE the word onto column4 ARV
Else
IF F2 = 1 AND F3 = 1 AND F4 = 1 then
WRITE the word onto column5 NRV
Else
IF F1 = 1 AND F2 = 1 then
WRITE the word onto column6 AN
Else
IF F1 = 1 AND F3 = 1 then
WRITE the word onto column7 AR
Else
IF F1 = 1 AND F4 = 1 then
WRITE the word onto column8 AV
Else
IF F2 = 1 AND F3 = 1 then
WRITE the word onto column9 NR
Else
IF F2 = 1 AND F4 = 1 then
WRITE the word onto column10 NV
Else
IF F3 = 1 AND F4 = 1 then
WRITE the word onto column11 ANV
Else
IF F1 = 1 then
WRITE the word onto column12 A
Else
IF F2 = 1 then
WRITE the word onto column13 N
Else
IF F3 = 1 then
WRITE the word onto column 14 R
Else
IF F4 = 1 then
WRITE the word onto column15 V
Else
WRITE the word onto column16 OTHERS
END
/* This can also implemented using methods like isnoun(), isadverb(), isverb() & isadjective(). These methods return Boolean values.
Take each word from the file and then using these methods set the flag values. Depending on the flag values right onto the respective file */
Display the contents of each file
Hi Lavanya,
I also have not tried using wordnet using Java. But will surely post the solution if i am able to use it smoothly.