net.java.sen.dictionary
Class Morpheme

java.lang.Object
  extended by net.java.sen.dictionary.Morpheme

public class Morpheme
extends Object

A class representing part-of-speech data for a morpheme. When created during the analysis of a string, a Morpheme is built as a lazy proxy onto the Dictionary's part-of-speech file. Once created, a Morpheme can be altered without changing the underlying data (if any)

Thread Safety: Objects of this class are NOT thread safe and should not be accessed simultaneously by multiple threads.

CAUTION: Morphemes are implemented as lazy proxies onto a Dictionary, and care should be taken not to access the same Dictionary from multiple threads. Once any member of a Morpheme has been read, its link to the Dictionary is broken and this restriction is relaxed


Constructor Summary
Morpheme()
          Creates a blank, modifiable Morpheme that does not link to any Dictionary
Morpheme(Dictionary dictionary, int partOfSpeechIndex)
          Builds a lazy proxy onto a part-of-speech stored in a Dictionary
Morpheme(String partOfSpeech, String conjugationalType, String conjugationalForm, String basicForm, String[] readings, String[] pronunciations, String additionalInformation)
          Creates a literal Morpheme that does not link to any Dictionary
 
Method Summary
 boolean equals(Object object)
           
 String getAdditionalInformation()
          Gets the additional information string
 String getBasicForm()
          Gets the unconjugated form of the morpheme
 String getConjugationalForm()
          Gets the conjugation form of the morpheme
 String getConjugationalType()
          Gets the conjugation type of the morpheme
 String getPartOfSpeech()
          Gets the part-of-speech in Chasen format
 List<String> getPronunciations()
          Gets the pronunciations of the morpheme
 List<String> getReadings()
          Gets the readings of the morpheme
 void setAdditionalInformation(String additionalInformation)
          Sets an arbitrary string of additional information
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Morpheme

public Morpheme(Dictionary dictionary,
                int partOfSpeechIndex)
Builds a lazy proxy onto a part-of-speech stored in a Dictionary

Parameters:
dictionary - The dicationary to proxy upon
partOfSpeechIndex - The index into the part-of-speech file

Morpheme

public Morpheme(String partOfSpeech,
                String conjugationalType,
                String conjugationalForm,
                String basicForm,
                String[] readings,
                String[] pronunciations,
                String additionalInformation)
Creates a literal Morpheme that does not link to any Dictionary

Parameters:
partOfSpeech - The Chasen-format part-of-speech
conjugationalType - The conjugational type
conjugationalForm - The conjugational form
basicForm - The unconjugated form
readings - The readings
pronunciations - The pronunciations
additionalInformation - Arbitrary additional information

Morpheme

public Morpheme()
Creates a blank, modifiable Morpheme that does not link to any Dictionary

Method Detail

getConjugationalType

public String getConjugationalType()
Gets the conjugation type of the morpheme

Returns:
The conjugation type

getConjugationalForm

public String getConjugationalForm()
Gets the conjugation form of the morpheme

Returns:
The conjugation form

getBasicForm

public String getBasicForm()
Gets the unconjugated form of the morpheme

Returns:
The unconjugated form

getReadings

public List<String> getReadings()
Gets the readings of the morpheme

Returns:
The readings

getPronunciations

public List<String> getPronunciations()
Gets the pronunciations of the morpheme

Returns:
The pronunciations

getPartOfSpeech

public String getPartOfSpeech()
Gets the part-of-speech in Chasen format

Returns:
The part-of-speech in Chasen format

getAdditionalInformation

public String getAdditionalInformation()
Gets the additional information string

Returns:
The additional information string

setAdditionalInformation

public void setAdditionalInformation(String additionalInformation)
Sets an arbitrary string of additional information

Parameters:
additionalInformation - The additional information to set

equals

public boolean equals(Object object)
Overrides:
equals in class Object

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2012. All Rights Reserved.