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

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)
          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
 

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)
Converts a parse tree into a string of tokens. Each token is a word and its POS tag separated by the delimiter specified by TaggedWord.setDivider(String)

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

main

public static void main(String[] args)


Stanford NLP Group