|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmoj.lang.se.GranskaConnection
public class GranskaConnection
GranskaConnection handles all communication with a Granska server. So far tokenizing, lemmatizing, tagging, parsing and grammar checking is only available for Swedish text input.
Field Summary | |
---|---|
java.net.URL |
granskaURL
URL to current Granska servlet |
java.net.URL |
gtaURL
URL to current GTA servlet |
java.net.URL |
inflectorURL
URL to current Inflector servlet |
Constructor Summary | |
---|---|
GranskaConnection()
Create a new GranskaConnection to the Granska server given in the file Granska.properties . |
|
GranskaConnection(java.lang.String filename)
Create a new GranskaConnection to the Granska server given in the Properties file filename . |
|
GranskaConnection(java.lang.String host,
int port,
java.lang.String path)
Create a new GranskaConnection to the given host at the
given port and path . |
Method Summary | |
---|---|
java.io.Reader |
granskaConnect(java.lang.String text,
java.net.URL servlet)
Sends the text text to a Granska/GTA/Inflector servlet and
returns an Reader "pointing" at the scrutinized text. |
java.lang.String |
inflect(java.lang.String word)
Inflects the given word. |
java.lang.String |
inflect(java.lang.String word,
java.lang.String wordclass)
Inflects the given word according to the paradigm of the given wordclass. |
java.lang.String |
lemmaTag(java.lang.String text)
Tokenizes, lemmatizes and PoS-tags the given text. |
java.lang.String |
lemmatize(java.lang.String text)
Tokenizes and lemmatizes the given text. |
static void |
main(java.lang.String[] args)
Usage: moj.lang.se.GranskaConnection <TOKENIZE|LEMMATIZE|LEMMATAG|POSTAG|PARSE|INFLECT|DEMO> <file|word> (<word class>) <TOKENIZE|LEMMATIZE|LEMMATAG|POSTAG|PARSE|INFLECT|DEMO> : keywords denoting desired function/output, or demo output <file|word> : file to tag words in, or word to inflect <word class> : inflection paradigm (if left out forms are generated for all PoS) |
org.xml.sax.InputSource |
parse(java.lang.String text)
Sends the text text to a GTA server and returns an
InputSource "pointing" at the parsed text. |
java.lang.String |
parseIOB(java.lang.String text)
Partial shallow parsing of the given text. |
java.lang.String |
posTag(java.lang.String text)
Tags the given text with morphosyntactic tags. |
org.xml.sax.InputSource |
scrutinize(java.lang.String text)
Sends the text text to a Granska server and returns an
InputSource "pointing" at the scrutinized text. |
java.lang.String |
simpleTag(java.lang.String text)
Deprecated. |
java.lang.String |
tokenize(java.lang.String text)
Tokenizes the given text. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public final java.net.URL inflectorURL
public final java.net.URL granskaURL
public final java.net.URL gtaURL
Constructor Detail |
---|
public GranskaConnection() throws java.net.MalformedURLException
Granska.properties
.
java.net.MalformedURLException
public GranskaConnection(java.lang.String host, int port, java.lang.String path) throws java.net.MalformedURLException
host
at the
given port
and path
.
host
- Granska server host to connect to.port
- port on Granska server to connect to.path
- path to the servlets on the Granska server.
java.net.MalformedURLException
public GranskaConnection(java.lang.String filename) throws java.net.MalformedURLException
Properties
file filename
.
java.net.MalformedURLException
Method Detail |
---|
public java.io.Reader granskaConnect(java.lang.String text, java.net.URL servlet)
text
to a Granska/GTA/Inflector servlet and
returns an Reader
"pointing" at the scrutinized text. The
returned XML-document contains information about lemmas and PoS-tags of
words as well as possible grammar errors.
text
- the text that is to be scrutinized by the Granska server.servlet
- servlet to connect to, i.e. Granska/GTA/Inflector.
public org.xml.sax.InputSource scrutinize(java.lang.String text)
text
to a Granska server and returns an
InputSource "pointing" at the scrutinized text. The returned XML-document
contains information about lemmas and PoS-tags of words as well as
possible grammar errors.
text
- the text that is to be scrutinized by the Granska server.
public org.xml.sax.InputSource parse(java.lang.String text)
text
to a GTA server and returns an
InputSource "pointing" at the parsed text. The returned XML-document
contains information about lemmas and PoS-tags of words as well as
phrase structure information.
text
- the text that is to be parsed by the GTA server.
public java.lang.String tokenize(java.lang.String text)
text
- the text that is to be tokenized.
null
if tokenize
fails.public java.lang.String lemmatize(java.lang.String text)
text
- the text that is to be tokenized and lemmatized.
null
if
lemmatize
fails.public java.lang.String lemmaTag(java.lang.String text)
text
- the text that is to be tokenized, lemmatized and PoS-tagged.
null
if lemmaTag
fails.@Deprecated public java.lang.String simpleTag(java.lang.String text)
public java.lang.String posTag(java.lang.String text)
text
- the text that is to be morphosyntacticly tagged.
null
if
posTag
fails.public java.lang.String parseIOB(java.lang.String text)
text
- the text that is to be parsed
null
if
parseIOB
fails.public java.lang.String inflect(java.lang.String word)
word
- the word that is to be inflected.
public java.lang.String inflect(java.lang.String word, java.lang.String wordclass)
word
- the word that is to be inflected.wordclass
- the wordclass of the word that is to be inflected.
public static void main(java.lang.String[] args)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |