From 37b29c8d337a080e9f53b1a304bfa3008d9bf5ad Mon Sep 17 00:00:00 2001
From: amontano The words must be stored in a binary file tree structure format.
- This can be done using the BinaryFileGenerator.
The words must be stored in a binary file tree structure format. - This can be done using the BinaryFileGenerator.
+ This can be done using the {@link BinaryFileGenerator}. @author Andrés Montano Pellegrini @see TibetanScanner diff --git a/source/org/thdl/tib/scanner/Link.java b/source/org/thdl/tib/scanner/Link.java index d34266c..4944570 100644 --- a/source/org/thdl/tib/scanner/Link.java +++ b/source/org/thdl/tib/scanner/Link.java @@ -19,6 +19,14 @@ Contributor(s): ______________________________________. package org.thdl.tib.scanner; import java.io.*; +/** Used by {@link LinkedList} to provide the implementation of a + simple dynamic link list. + + @author Andrés Montano Pellegrini + @see LinkedList + @see ListIterator +*/ + class Link { private Object obj; diff --git a/source/org/thdl/tib/scanner/LinkedList.java b/source/org/thdl/tib/scanner/LinkedList.java index 21bb388..5b01ec5 100644 --- a/source/org/thdl/tib/scanner/LinkedList.java +++ b/source/org/thdl/tib/scanner/LinkedList.java @@ -19,6 +19,12 @@ Contributor(s): ______________________________________. package org.thdl.tib.scanner; import java.util.*; +/** Implementation of a simple dynamic link list. Be careful with word order! + + @author Andrés Montano Pellegrini + @see Link + @see ListIterator +*/ public class LinkedList { protected Link cabeza; diff --git a/source/org/thdl/tib/scanner/ListIterator.java b/source/org/thdl/tib/scanner/ListIterator.java index 0b27b84..0c5c405 100644 --- a/source/org/thdl/tib/scanner/ListIterator.java +++ b/source/org/thdl/tib/scanner/ListIterator.java @@ -19,6 +19,14 @@ Contributor(s): ______________________________________. package org.thdl.tib.scanner; import java.util.*; +/** Used by {@link LinkedList} to provide the implementation of a + simple dynamic link list. + + @author Andrés Montano Pellegrini + @see LinkedList + @see Link +*/ + public class ListIterator { Link current; diff --git a/source/org/thdl/tib/scanner/LocalTibetanScanner.java b/source/org/thdl/tib/scanner/LocalTibetanScanner.java index 6816ba2..54449a1 100644 --- a/source/org/thdl/tib/scanner/LocalTibetanScanner.java +++ b/source/org/thdl/tib/scanner/LocalTibetanScanner.java @@ -20,6 +20,13 @@ package org.thdl.tib.scanner; import java.util.*; import java.io.*; +/** Loads dictionary stored in tree format and searches for words recursively. + How the the dictionary is loaded depends on which implementation of + {@link SyllableListTree} is invoked. + + @author Andrés Montano Pellegrini + @see SyllableListTree +*/ class LocalTibetanScanner implements TibetanScanner { public static String archivo; diff --git a/source/org/thdl/tib/scanner/Manipulate.java b/source/org/thdl/tib/scanner/Manipulate.java index 40601cb..f4aad9a 100644 --- a/source/org/thdl/tib/scanner/Manipulate.java +++ b/source/org/thdl/tib/scanner/Manipulate.java @@ -20,9 +20,7 @@ package org.thdl.tib.scanner; import java.io.*; -/** Takes the output of ConsoleScannerFilter - (in RY format), converts the Wylie to Acip - and displays the result in csv format. +/** Miscelaneous methods for the manipulation of Tibetan text. @author Andrés Montano Pellegrini */ @@ -220,9 +218,13 @@ public class Manipulate return linea; } - /** - * Sintaxis: java Manipulate [arch-palabras] < dict-orig > dict-dest - * + /** Not really important. + + Sintaxis: java Manipulate [word-file] < source-dic-entries > dest-dic-entries + + Takes the output of ConsoleScannerFilter + (in RY format), converts the Wylie to Acip + and displays the result in csv format. * arch-palabras es usado solo cuando deseamos las palabras cambiadas * a otro archivo. */ diff --git a/source/org/thdl/tib/scanner/MemorySyllableListTree.java b/source/org/thdl/tib/scanner/MemorySyllableListTree.java index dc1a312..9330c5f 100644 --- a/source/org/thdl/tib/scanner/MemorySyllableListTree.java +++ b/source/org/thdl/tib/scanner/MemorySyllableListTree.java @@ -20,6 +20,20 @@ package org.thdl.tib.scanner; import java.util.*; import java.io.*; +/** Loads the whole dictionary into memory; not the preferred + implementation. Provides the fastest search, but takes up to + much resources. The preferred implementation is the + {@link CachedSyllableListTree}. + +The words must be stored in a binary file tree structure format. + This can be done using the {@link BinaryFileGenerator}.
+ + @author Andrés Montano Pellegrini + @see TibetanScanner + @see CachedSyllableListTree + @see BinaryFileGenerator +*/ + public class MemorySyllableListTree extends LinkedList implements SyllableListTree { protected String sil, def; diff --git a/source/org/thdl/tib/scanner/OnLineScannerFilter.java b/source/org/thdl/tib/scanner/OnLineScannerFilter.java index 3c97366..0cf372b 100644 --- a/source/org/thdl/tib/scanner/OnLineScannerFilter.java +++ b/source/org/thdl/tib/scanner/OnLineScannerFilter.java @@ -25,6 +25,14 @@ import javax.servlet.*; import javax.servlet.http.*; import org.thdl.tib.text.TibetanHTML; +/** Interfase to provide access to an on-line dictionary through a form in html; + Inputs Tibetan text (Roman script only) and displays the + words (Roman or Tibetan script) with their definitions. + Runs on the server and is called upon through an HTTP request directly + by the browser. Requires no additional software installed on the client. + + @author Andrés Montano Pellegrini +*/ public class OnLineScannerFilter extends HttpServlet { ResourceBundle rb; diff --git a/source/org/thdl/tib/scanner/PunctuationMark.java b/source/org/thdl/tib/scanner/PunctuationMark.java index 9aa8d08..d0fc5c5 100644 --- a/source/org/thdl/tib/scanner/PunctuationMark.java +++ b/source/org/thdl/tib/scanner/PunctuationMark.java @@ -18,6 +18,14 @@ Contributor(s): ______________________________________. package org.thdl.tib.scanner; +/** Right now, it only used by {@link LocalTibetanScanner} to + separate "paragraphs"; eventually it will be one + of many tokens representing grammatical parts of the sentences that will be + interpreted by the parser. + + @author Andrés Montano Pellegrini + @see LocalTibetanScanner +*/ class PunctuationMark extends Token { public PunctuationMark(char ch) diff --git a/source/org/thdl/tib/scanner/RemoteScannerFilter.java b/source/org/thdl/tib/scanner/RemoteScannerFilter.java index 0b642cc..5bb5813 100644 --- a/source/org/thdl/tib/scanner/RemoteScannerFilter.java +++ b/source/org/thdl/tib/scanner/RemoteScannerFilter.java @@ -24,6 +24,13 @@ import java.util.*; import javax.servlet.*; import javax.servlet.http.*; +/** Running on the server, receives the tibetan text from applet/applications running on + the client and sends them the words with their definitions through the Internet. + Requests are made through {@link RemoteTibetanScanner}. + + @author Andrés Montano Pellegrini + @see RemoteTibetanScanner +*/ public class RemoteScannerFilter extends GenericServlet { private TibetanScanner scanner; diff --git a/source/org/thdl/tib/scanner/RemoteTibetanScanner.java b/source/org/thdl/tib/scanner/RemoteTibetanScanner.java index 832fc01..4d3f8bf 100644 --- a/source/org/thdl/tib/scanner/RemoteTibetanScanner.java +++ b/source/org/thdl/tib/scanner/RemoteTibetanScanner.java @@ -20,6 +20,13 @@ package org.thdl.tib.scanner; import java.net.*; import java.io.*; +/** Used by applets and applications to access remote on-line dictionaries. + Sends Tibetan text, and receives the words with their definitions. The + {@link RemoteScannerFilter} receives the requests on the server. + + @author Andrés Montano Pellegrini + @see RemoteScannerFilter +*/ public class RemoteTibetanScanner implements TibetanScanner { private String url; diff --git a/source/org/thdl/tib/scanner/SimpleScannerPanel.java b/source/org/thdl/tib/scanner/SimpleScannerPanel.java index a5dd772..97ac944 100644 --- a/source/org/thdl/tib/scanner/SimpleScannerPanel.java +++ b/source/org/thdl/tib/scanner/SimpleScannerPanel.java @@ -20,6 +20,16 @@ package org.thdl.tib.scanner; import java.awt.*; import java.awt.event.*; +/** A non-Swing graphical interfase to be used by applications + running on platforms that don't support Swing, + to input a Tibetan text (in Roman script only) and + display the words (in Roman script only) with their + definitions (in Roman script). + + @author Andrés Montano Pellegrini + @see WindowScannerFilter +*/ + public class SimpleScannerPanel extends ScannerPanel { private TextArea txtInput, txtOutput; diff --git a/source/org/thdl/tib/scanner/SyllableListTree.java b/source/org/thdl/tib/scanner/SyllableListTree.java index 7fe7cef..15101c6 100644 --- a/source/org/thdl/tib/scanner/SyllableListTree.java +++ b/source/org/thdl/tib/scanner/SyllableListTree.java @@ -27,6 +27,12 @@ Contributor(s): ______________________________________. package org.thdl.tib.scanner; +/** The generic interface for accesing dictionaries. An instance of + a SyllableListTree represents a node containing a syllable, a definition + (if it is the last syllable of a word) and links to its "children". + + @author Andrés Montano Pellegrini +*/ public interface SyllableListTree { public String getDef(); diff --git a/source/org/thdl/tib/scanner/TibetanScanner.java b/source/org/thdl/tib/scanner/TibetanScanner.java index c879513..7296f02 100644 --- a/source/org/thdl/tib/scanner/TibetanScanner.java +++ b/source/org/thdl/tib/scanner/TibetanScanner.java @@ -19,6 +19,10 @@ Contributor(s): ______________________________________. package org.thdl.tib.scanner; import java.util.*; +/** Defines the core methods required to provide access to a dictionary; local or remote. + + @author Andrés Montano Pellegrini +*/ public interface TibetanScanner { public static final String copyrightUnicode="Copyright " + '\u00A9' + " 2000-2002 by Andr" + '\u00E9' + "s Montano Pellegrini, all rights reserved."; diff --git a/source/org/thdl/tib/scanner/Token.java b/source/org/thdl/tib/scanner/Token.java index 5f9ef0c..c2a5676 100644 --- a/source/org/thdl/tib/scanner/Token.java +++ b/source/org/thdl/tib/scanner/Token.java @@ -17,6 +17,12 @@ Contributor(s): ______________________________________. */ package org.thdl.tib.scanner; + +/** Represents a basic grammatical unit; seems unnecessary but when the parser + is developed it will make sense. + + @author Andrés Montano Pellegrini +*/ public class Token { protected String token; diff --git a/source/org/thdl/tib/scanner/WindowScannerFilter.java b/source/org/thdl/tib/scanner/WindowScannerFilter.java index 0205fe5..bf711f7 100644 --- a/source/org/thdl/tib/scanner/WindowScannerFilter.java +++ b/source/org/thdl/tib/scanner/WindowScannerFilter.java @@ -28,6 +28,14 @@ import java.awt.datatransfer.*; import javax.swing.text.JTextComponent; import org.thdl.tib.input.DuffPane; +/** Provides a graphical interfase to input Tibetan text (Roman or + Tibetan script) and displays the words (Roman or Tibetan script) + with their definitions. Works without Tibetan script in + platforms that don't support Swing. Can access dictionaries stored + locally or remotely. + + @author Andrés Montano Pellegrini +*/ public class WindowScannerFilter implements WindowListener, FocusListener, ActionListener, ItemListener { private ScannerPanel sp; diff --git a/source/org/thdl/tib/scanner/Word.java b/source/org/thdl/tib/scanner/Word.java index 861ebcc..3c72cb0 100644 --- a/source/org/thdl/tib/scanner/Word.java +++ b/source/org/thdl/tib/scanner/Word.java @@ -22,6 +22,10 @@ package org.thdl.tib.scanner; import org.thdl.tib.text.TibetanHTML; +/** Tibetan word with its corresponding definitions. + + @author Andrés Montano Pellegrini +*/ public class Word extends Token { /** Used to rebuild the text the user entered. */