edu.mit.jwi.data.parse
Class IndexLineParser

java.lang.Object
  extended by edu.mit.jwi.data.parse.IndexLineParser
All Implemented Interfaces:
ILineParser<IIndexWord>

public class IndexLineParser
extends java.lang.Object
implements ILineParser<IIndexWord>

Parser parser for Wordnet index files (e.g., idx.adv or adv.idx). It produces an IIndexWord object.

This class follows a singleton design pattern, and is not intended to be instantiated directly; rather, call the getInstance() method to get the singleton instance.

Since:
JWI 1.0
Version:
2.4.0
Author:
Mark A. Finlayson

Nested Class Summary
 
Nested classes/interfaces inherited from interface edu.mit.jwi.data.parse.ILineParser
ILineParser.MisformattedLineException
 
Constructor Summary
protected IndexLineParser()
          This constructor is marked protected so that the class may be sub-classed, but not directly instantiated.
 
Method Summary
static IndexLineParser getInstance()
          Returns the singleton instance of this class, instantiating it if necessary.
 IIndexWord parseLine(java.lang.String line)
          Given the line of data, this method produces an object of class T.
protected  IPointer resolvePointer(java.lang.String symbol, POS pos)
           Retrieves the pointer objects for the parseLine(String) method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IndexLineParser

protected IndexLineParser()
This constructor is marked protected so that the class may be sub-classed, but not directly instantiated. Obtain instances of this class via the static getInstance() method.

Since:
JWI 2.0.0
Method Detail

getInstance

public static IndexLineParser getInstance()
Returns the singleton instance of this class, instantiating it if necessary. The singleton instance will not be null.

Returns:
the non-null singleton instance of this class, instantiating it if necessary.
Since:
JWI 2.0.0

parseLine

public IIndexWord parseLine(java.lang.String line)
Description copied from interface: ILineParser
Given the line of data, this method produces an object of class T.

Specified by:
parseLine in interface ILineParser<IIndexWord>
Parameters:
line - the line to be parsed
Returns:
the object resulting from the parse

resolvePointer

protected IPointer resolvePointer(java.lang.String symbol,
                                  POS pos)

Retrieves the pointer objects for the parseLine(String) method.

This is implemented in its own method for ease of subclassing.

Parameters:
symbol - the symbol of the pointer to return
pos - the part of speech of the pointer to return, can be null unless the pointer symbol is ambiguous
Returns:
the pointer corresponding to the specified symbol and part of speech combination
Throws:
java.lang.NullPointerException - if the symbol is null
java.lang.IllegalArgumentException - if the symbol and part of speech combination does not correspond to a known pointer
Since:
JWI 2.3.0


Copyright © 2007-2013 Massachusetts Institute of Technology. All Rights Reserved.