gpl.pierrick.brihaye.aramorph
Class AraMorph

java.lang.Object
  extended bygpl.pierrick.brihaye.aramorph.AraMorph

public class AraMorph
extends java.lang.Object

A java port of Buckwalter Arabic Morphological Analyzer Version 1.0. Original Perl distribution avalaible from : LDC Catalog

Author:
Pierrick Brihaye, 2003

Field Summary
protected static gpl.pierrick.brihaye.aramorph.InMemorySolutionsHandler sol
          The solutions handler.
protected  boolean verbose
          Whether or not the analyzer should output some convenience messages
 
Constructor Summary
AraMorph()
          Constructs an arabic morphological analyzer that will output nothing.
AraMorph(java.io.PrintStream outputStream, boolean verbose)
          Constructs an arabic morphological analyzer
 
Method Summary
 boolean analyzeToken(java.lang.String token)
          Analyzes a token and return the results in the Buckwalter transliteration system.
 boolean analyzeToken(java.lang.String token, boolean outputBuckwalter)
          Analyzes a token.
static java.lang.String arabizeWord(java.lang.String translitered)
          Return an word in arabic from a word in the Buckwalter transliteration system.
 java.util.HashSet getWordSolutions(java.lang.String word)
          Returns the solutions for a previously analyzed word.
static void main(java.lang.String[] args)
          Entry point for command line interface.
 void printStats()
          Display the statistics on what has been analyzed so far.
static java.lang.String romanizeWord(java.lang.String word)
          Returns a word in the Buckwalter transliteration system from a word in arabic.
 void setVerbose(boolean verbose)
          Whether or not the analyzer should output some convenience messages
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sol

protected static gpl.pierrick.brihaye.aramorph.InMemorySolutionsHandler sol
The solutions handler. TODO : use more generic interface.


verbose

protected boolean verbose
Whether or not the analyzer should output some convenience messages

Constructor Detail

AraMorph

public AraMorph()
Constructs an arabic morphological analyzer that will output nothing.


AraMorph

public AraMorph(java.io.PrintStream outputStream,
                boolean verbose)
Constructs an arabic morphological analyzer

Parameters:
outputStream - The stream where to output the results. Can be null if no output is desired
verbose - Whether or not the analyzer should output some convenience messages
Method Detail

setVerbose

public void setVerbose(boolean verbose)
Whether or not the analyzer should output some convenience messages

Parameters:
verbose - Output status

romanizeWord

public static java.lang.String romanizeWord(java.lang.String word)
Returns a word in the Buckwalter transliteration system from a word in arabic. Vowels and diacritics are discarded.

Parameters:
word - The word in arabic
Returns:
The romanized word

arabizeWord

public static java.lang.String arabizeWord(java.lang.String translitered)
Return an word in arabic from a word in the Buckwalter transliteration system.

Parameters:
translitered - The romanized word
Returns:
The word in arabic

analyzeToken

public boolean analyzeToken(java.lang.String token)
Analyzes a token and return the results in the Buckwalter transliteration system. For performance issues, the analyzer keeps track of the results.

Parameters:
token - The token to be analyzed
Returns:
Whether or not the word has a solution in arabic

analyzeToken

public boolean analyzeToken(java.lang.String token,
                            boolean outputBuckwalter)
Analyzes a token. For performance issues, the analyzer keeps track of the results.

Parameters:
outputBuckwalter - Whether or not the Buckwalter transliteration system should be used. If not, outputs will be in arabic wherever possible
token - The token to be analyzed
Returns:
Whether or not the word has a solution in arabic

getWordSolutions

public java.util.HashSet getWordSolutions(java.lang.String word)
Returns the solutions for a previously analyzed word.

Parameters:
word - The word.
Returns:
A list of solutions
See Also:
Solution

printStats

public void printStats()
Display the statistics on what has been analyzed so far.


main

public static void main(java.lang.String[] args)
Entry point for command line interface.

Parameters:
args - Arguments