edu.stanford.nlp.trees.international.arabic
Class ATBTreeUtils

java.lang.Object
  extended by edu.stanford.nlp.trees.international.arabic.ATBTreeUtils

public class ATBTreeUtils
extends Object

Various static convenience methods for processing Arabic parse trees.

Author:
Spence Green

Field Summary
static String morphBoundary
           
static String puncTag
           
static Set<String> reservedWords
           
static String segMarker
           
 
Method Summary
static String escape(String s)
          Escapes tokens from flat strings that are reserved for usage in the ATB.
static String flattenTree(Tree t)
          Returns the string associated with the input parse tree.
static void main(String[] args)
           
static String taggedStringFromTree(Tree t, boolean removeEscaping, String separator)
          Converts a parse tree into a string of tokens.
static String unEscape(String s)
          Reverts escaping from a flat string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

segMarker

public static String segMarker

morphBoundary

public static final String morphBoundary
See Also:
Constant Field Values

puncTag

public static final String puncTag
See Also:
Constant Field Values

reservedWords

public static final Set<String> reservedWords
Method Detail

escape

public static String escape(String s)
Escapes tokens from flat strings that are reserved for usage in the ATB.

Parameters:
s - - An Arabic string
Returns:
A string with all reserved words replaced by the appropriate tokens

unEscape

public static String unEscape(String s)
Reverts escaping from a flat string.

Parameters:
s - - An Arabic string
Returns:
A string with all reserved words inserted into the appropriate locations

flattenTree

public static String flattenTree(Tree t)
Returns the string associated with the input parse tree. Traces and ATB-specific escape sequences (e.g., "-RRB-" for ")") are removed.

Parameters:
t - - A parse tree
Returns:
The yield of the input parse tree

taggedStringFromTree

public static String taggedStringFromTree(Tree t,
                                          boolean removeEscaping,
                                          String separator)
Converts a parse tree into a string of tokens. Each token is a word and its POS tag separated by the delimiter specified by separator

Parameters:
t - - A parse tree
removeEscaping - - If true, remove LDC escape characters. Otherwise, leave them.
separator - Word/tag separator
Returns:
A string of tagged words

main

public static void main(String[] args)


Stanford NLP Group