Java Doc for DictionaryBasedBreakIterator.java in  » 6.0-JDK-Modules » j2me » java » text » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » 6.0 JDK Modules » j2me » java.text 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   java.text.BreakIterator
      java.text.RuleBasedBreakIterator
         java.text.DictionaryBasedBreakIterator

DictionaryBasedBreakIterator
class DictionaryBasedBreakIterator extends RuleBasedBreakIterator (Code)
A subclass of RuleBasedBreakIterator that adds the ability to use a dictionary to further subdivide ranges of text beyond what is possible using just the state-table-based algorithm. This is necessary, for example, to handle word and line breaking in Thai, which doesn't use spaces between words. The state-table-based algorithm used by RuleBasedBreakIterator is used to divide up text as far as possible, and then contiguous ranges of letters are repeatedly compared against a list of known words (i.e., the dictionary) to divide them up into words. DictionaryBasedBreakIterator uses the same rule language as RuleBasedBreakIterator, but adds one more special substitution name: <dictionary>. This substitution name is used to identify characters in words in the dictionary. The idea is that if the iterator passes over a chunk of text that includes two or more characters in a row that are included in <dictionary>, it goes back through that range and derives additional break positions (if possible) using the dictionary. DictionaryBasedBreakIterator is also constructed with the filename of a dictionary file. It follows a prescribed search path to locate the dictionary (right now, it looks for it in /com/ibm/text/resources in each directory in the classpath, and won't find it in JAR files, but this location is likely to change). The dictionary file is in a serialized binary format. We have a very primitive (and slow) BuildDictionaryFile utility for creating dictionary files, but aren't currently making it public. Contact us for help.

Inner Class :protected class Builder extends RuleBasedBreakIterator.Builder


Constructor Summary
public  DictionaryBasedBreakIterator(String description, InputStream dictionaryStream)
     Constructs a DictionaryBasedBreakIterator.
Parameters:
  description - Same as the description parameter on RuleBasedBreakIterator,except for the special meaning of "".

Method Summary
public  intfirst()
     Sets the current iteration position to the beginning of the text.
public  intfollowing(int offset)
     Sets the current iteration position to the first boundary position after the specified position.
protected  inthandleNext()
     This is the implementation function for next().
public  intlast()
     Sets the current iteration position to the end of the text.
protected  intlookupCategory(char c)
     Looks up a character category for a character.
protected  RuleBasedBreakIterator.BuildermakeBuilder()
     Returns a Builder that is customized to build a DictionaryBasedBreakIterator.
public  intpreceding(int offset)
     Sets the current iteration position to the last boundary position before the specified position.
public  intprevious()
     Advances the iterator one step backwards.
public  voidsetText(CharacterIterator newText)
    


Constructor Detail
DictionaryBasedBreakIterator
public DictionaryBasedBreakIterator(String description, InputStream dictionaryStream) throws IOException(Code)
Constructs a DictionaryBasedBreakIterator.
Parameters:
  description - Same as the description parameter on RuleBasedBreakIterator,except for the special meaning of "". This parameter is justpassed through to RuleBasedBreakIterator's constructor.
Parameters:
  dictionaryFilename - The filename of the dictionary file to use




Method Detail
first
public int first()(Code)
Sets the current iteration position to the beginning of the text. (i.e., the CharacterIterator's starting offset). The offset of the beginning of the text.



following
public int following(int offset)(Code)
Sets the current iteration position to the first boundary position after the specified position.
Parameters:
  offset - The position to begin searching forward from The position of the first boundary after "offset"



handleNext
protected int handleNext()(Code)
This is the implementation function for next().



last
public int last()(Code)
Sets the current iteration position to the end of the text. (i.e., the CharacterIterator's ending offset). The text's past-the-end offset.



lookupCategory
protected int lookupCategory(char c)(Code)
Looks up a character category for a character.



makeBuilder
protected RuleBasedBreakIterator.Builder makeBuilder()(Code)
Returns a Builder that is customized to build a DictionaryBasedBreakIterator. This is the same as RuleBasedBreakIterator.Builder, except for the extra code to handle the tag.



preceding
public int preceding(int offset)(Code)
Sets the current iteration position to the last boundary position before the specified position.
Parameters:
  offset - The position to begin searching from The position of the last boundary before "offset"



previous
public int previous()(Code)
Advances the iterator one step backwards. The position of the last boundary position before thecurrent iteration position



setText
public void setText(CharacterIterator newText)(Code)



Fields inherited from java.text.RuleBasedBreakIterator
final protected static byte IGNORE(Code)(Java Doc)

Methods inherited from java.text.RuleBasedBreakIterator
final protected static void checkOffset(int offset, CharacterIterator text)(Code)(Java Doc)
public Object clone()(Code)(Java Doc)
public int current()(Code)(Java Doc)
public boolean equals(Object that)(Code)(Java Doc)
public int first()(Code)(Java Doc)
public int following(int offset)(Code)(Java Doc)
public CharacterIterator getText()(Code)(Java Doc)
protected int handleNext()(Code)(Java Doc)
protected int handlePrevious()(Code)(Java Doc)
public int hashCode()(Code)(Java Doc)
public boolean isBoundary(int offset)(Code)(Java Doc)
public int last()(Code)(Java Doc)
protected int lookupBackwardState(int state, int category)(Code)(Java Doc)
protected int lookupCategory(char c)(Code)(Java Doc)
protected int lookupState(int state, int category)(Code)(Java Doc)
protected Builder makeBuilder()(Code)(Java Doc)
public int next(int n)(Code)(Java Doc)
public int next()(Code)(Java Doc)
public int preceding(int offset)(Code)(Java Doc)
public int previous()(Code)(Java Doc)
public void setText(CharacterIterator newText)(Code)(Java Doc)
public String toString()(Code)(Java Doc)

Fields inherited from java.text.BreakIterator
final public static int DONE(Code)(Java Doc)

Methods inherited from java.text.BreakIterator
public Object clone()(Code)(Java Doc)
abstract public int current()(Code)(Java Doc)
abstract public int first()(Code)(Java Doc)
abstract public int following(int offset)(Code)(Java Doc)
public static synchronized Locale[] getAvailableLocales()(Code)(Java Doc)
public static BreakIterator getCharacterInstance()(Code)(Java Doc)
public static BreakIterator getCharacterInstance(Locale where)(Code)(Java Doc)
public static BreakIterator getLineInstance()(Code)(Java Doc)
public static BreakIterator getLineInstance(Locale where)(Code)(Java Doc)
public static BreakIterator getSentenceInstance()(Code)(Java Doc)
public static BreakIterator getSentenceInstance(Locale where)(Code)(Java Doc)
abstract public CharacterIterator getText()(Code)(Java Doc)
public static BreakIterator getWordInstance()(Code)(Java Doc)
public static BreakIterator getWordInstance(Locale where)(Code)(Java Doc)
public boolean isBoundary(int offset)(Code)(Java Doc)
abstract public int last()(Code)(Java Doc)
abstract public int next(int n)(Code)(Java Doc)
abstract public int next()(Code)(Java Doc)
public int preceding(int offset)(Code)(Java Doc)
abstract public int previous()(Code)(Java Doc)
public void setText(String newText)(Code)(Java Doc)
abstract public void setText(CharacterIterator newText)(Code)(Java Doc)

Methods inherited from java.lang.Object
public boolean equals(Object obj)(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.