edu.mit.jwi.data.parse
Class SenseLineParser

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

public class SenseLineParser
extends java.lang.Object
implements ILineParser<ISenseEntry>

Parser for Wordnet sense index files (e.g., index.sense or sense.index). It produces an ISenseEntry 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 2.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
 
Field Summary
protected  ILineParser<ISenseKey> keyParser
           
 
Constructor Summary
protected SenseLineParser()
          This constructor is marked protected so that the class may be sub-classed, but not directly instantiated.
protected SenseLineParser(ILineParser<ISenseKey> keyParser)
          This constructor is marked protected so that the class may be sub-classed, but not directly instantiated.
 
Method Summary
static SenseLineParser getInstance()
          Returns the singleton instance of this class, instantiating it if necessary.
 ISenseEntry parseLine(java.lang.String line)
          Given the line of data, this method produces an object of class T.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

keyParser

protected final ILineParser<ISenseKey> keyParser
Constructor Detail

SenseLineParser

protected SenseLineParser()
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.1.0

SenseLineParser

protected SenseLineParser(ILineParser<ISenseKey> keyParser)
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.

Parameters:
keyParser - the sense key parser this sense line parser should use
Throws:
java.lang.NullPointerException - if the specified key parser is null
Since:
JWI 2.2.0
Method Detail

getInstance

public static SenseLineParser 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.1.0

parseLine

public ISenseEntry 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<ISenseEntry>
Parameters:
line - the line to be parsed
Returns:
the object resulting from the parse


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