net.sourceforge.nrl.parser.preprocessing
Class ReferencePreprocessor

java.lang.Object
  extended by net.sourceforge.nrl.parser.preprocessing.ReferencePreprocessor

public class ReferencePreprocessor
extends Object

The reference processor class detects fragment references, and resolves them before the main parsing stage.

It scans the rule file for fragment declarations, and then for any sentence fragments that equal the fragment declaration. If it finds any, it puts the curly brackets that the parser expects around them.

For example, if "this is a fragment" is declared as a fragment somewhere and the text this is a fragment is detected in the rule file, it has curly brackets placed around it.


Constructor Summary
ReferencePreprocessor()
           
 
Method Summary
 String[] getFragmentNames(String input)
          Return all fragment names declared in a file
 String process(String input)
           
 String process(String input, String[] properties)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReferencePreprocessor

public ReferencePreprocessor()
Method Detail

process

public String process(String input)

process

public String process(String input,
                      String[] properties)

getFragmentNames

public String[] getFragmentNames(String input)
Return all fragment names declared in a file

Returns:
the fragment names


Copyright © 2006-2010 Christian Nentwich and others