net.sourceforge.nrl.parser.preprocessing
Class ReferencePreprocessor
java.lang.Object
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.
- Author:
- Christian Nentwich
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
VALIDATION_FRAGMENT_KEYWORD
protected static final String VALIDATION_FRAGMENT_KEYWORD
- See Also:
- Constant Field Values
ACTION_FRAGMENT_KEYWORD
protected static final String ACTION_FRAGMENT_KEYWORD
- See Also:
- Constant Field Values
PROP_START
protected static final char PROP_START
- See Also:
- Constant Field Values
PROP_END
protected static final char PROP_END
- See Also:
- Constant Field Values
ReferencePreprocessor
public ReferencePreprocessor()
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
isQuotedLine
protected boolean isQuotedLine(String input,
int pos)
- Return true if the position is in a quoted line
- Parameters:
input
- the documentpos
- position
- Returns:
- true if quoted, false otherwise
Copyright © 2006-2013. All Rights Reserved.