edu.stanford.nlp.lexgram
Class SimpleGrammarFileReader

java.lang.Object
  |
  +--edu.stanford.nlp.lexgram.SimpleGrammarFileReader

public final class SimpleGrammarFileReader
extends Object

A simple class to read grammars. The format of the grammars is:

  # lines beginning with a hash (can be preceded by whitespace) are ignored
  cat -> cat+ %% score
  
A rule may not have an empty righthand side. It must have a score, even if this is going to be ignored later


Constructor Summary
SimpleGrammarFileReader(File file)
           
SimpleGrammarFileReader(String filename)
           
 
Method Summary
 void addAllToGrammar(SimpleGrammar grammar)
           
 SimpleRule readRule()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleGrammarFileReader

public SimpleGrammarFileReader(File file)
                        throws FileNotFoundException

SimpleGrammarFileReader

public SimpleGrammarFileReader(String filename)
                        throws FileNotFoundException
Method Detail

readRule

public SimpleRule readRule()

addAllToGrammar

public void addAllToGrammar(SimpleGrammar grammar)


Stanford NLP Group