Java Doc for DictionaryBasedBreakIterator.java in  » Internationalization-Localization » icu4j » com » ibm » icu » 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 » Internationalization Localization » icu4j » com.ibm.icu.text 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.ibm.icu.text.BreakIterator
      com.ibm.icu.text.RuleBasedBreakIterator
         com.ibm.icu.text.DictionaryBasedBreakIterator

DictionaryBasedBreakIterator
public 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_Old 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_Old, 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 uses Class.getResource() to locate the dictionary file. 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.



Constructor Summary
public  DictionaryBasedBreakIterator(String rules, InputStream dictionaryStream)
     Constructs a DictionaryBasedBreakIterator.
Parameters:
  rules - Same as the rules parameter on RuleBasedBreakIterator,except for the special meaning of "_dictionary_".
public  DictionaryBasedBreakIterator(InputStream compiledRules, InputStream dictionaryStream)
     Construct a DictionarBasedBreakIterator from precompiled rules.

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.
public  intgetRuleStatus()
     Return the status tag from the break rule that determined the most recently returned break position.
public  intgetRuleStatusVec(int[] fillInArray)
     Get the status (tag) values from the break rule(s) that determined the most recently returned break position.
protected  inthandleNext()
     This is the implementation function for next().
public  intlast()
     Sets the current iteration position to the end of the text.
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 rules, InputStream dictionaryStream) throws IOException(Code)
Constructs a DictionaryBasedBreakIterator.
Parameters:
  rules - Same as the rules parameter on RuleBasedBreakIterator,except for the special meaning of "_dictionary_". This parameter is justpassed through to RuleBasedBreakIterator constructor.
Parameters:
  dictionaryStream - the stream containing the dictionary data



DictionaryBasedBreakIterator
public DictionaryBasedBreakIterator(InputStream compiledRules, InputStream dictionaryStream) throws IOException(Code)
Construct a DictionarBasedBreakIterator from precompiled rules.
Parameters:
  compiledRules - an input stream containing the binary (flattened) compiled rules.
Parameters:
  dictionaryStream - an input stream containing the dictionary data




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"



getRuleStatus
public int getRuleStatus()(Code)
Return the status tag from the break rule that determined the most recently returned break position. TODO: not supported with dictionary based break iterators. the status from the break rule that determined the most recentlyreturned break position.



getRuleStatusVec
public int getRuleStatusVec(int[] fillInArray)(Code)
Get the status (tag) values from the break rule(s) that determined the most recently returned break position. The values appear in the rule source within brackets, {123}, for example. The default status value for rules that do not explicitly provide one is zero.

TODO: not supported for dictionary based break iterator.
Parameters:
  fillInArray - an array to be filled in with the status values. The number of rule status values from rules that determined the most recent boundary returned by the break iterator.In the event that the array is too small, the return valueis the total number of status values that were available,not the reduced number that were actually returned.




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.



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 com.ibm.icu.text.RuleBasedBreakIterator
final public static int WORD_IDEO(Code)(Java Doc)
final public static int WORD_IDEO_LIMIT(Code)(Java Doc)
final public static int WORD_KANA(Code)(Java Doc)
final public static int WORD_KANA_LIMIT(Code)(Java Doc)
final public static int WORD_LETTER(Code)(Java Doc)
final public static int WORD_LETTER_LIMIT(Code)(Java Doc)
final public static int WORD_NONE(Code)(Java Doc)
final public static int WORD_NONE_LIMIT(Code)(Java Doc)
final public static int WORD_NUMBER(Code)(Java Doc)
final public static int WORD_NUMBER_LIMIT(Code)(Java Doc)
protected static String fDebugEnv(Code)(Java Doc)
protected int fDictionaryCharCount(Code)(Java Doc)
protected RBBIDataWrapper fRData(Code)(Java Doc)
public static boolean fTrace(Code)(Java Doc)

Methods inherited from com.ibm.icu.text.RuleBasedBreakIterator
static int CICurrent32(CharacterIterator ci)(Code)(Java Doc)
static int CINext32(CharacterIterator ci)(Code)(Java Doc)
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 void dump()(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 static RuleBasedBreakIterator getInstanceFromCompiledRules(InputStream is) throws IOException(Code)(Java Doc)
public int getRuleStatus()(Code)(Java Doc)
public int getRuleStatusVec(int[] fillInArray)(Code)(Java Doc)
public CharacterIterator getText()(Code)(Java Doc)
int handleNext()(Code)(Java Doc)
public int hashCode()(Code)(Java Doc)
public boolean isBoundary(int offset)(Code)(Java Doc)
boolean isDictionaryChar(int c)(Code)(Java Doc)
public int last()(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 com.ibm.icu.text.BreakIterator
final public static int DONE(Code)(Java Doc)
final public static int KIND_CHARACTER(Code)(Java Doc)
final public static int KIND_LINE(Code)(Java Doc)
final public static int KIND_SENTENCE(Code)(Java Doc)
final public static int KIND_TITLE(Code)(Java Doc)
final public static int KIND_WORD(Code)(Java Doc)

Methods inherited from com.ibm.icu.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 synchronized ULocale[] getAvailableULocales()(Code)(Java Doc)
public static BreakIterator getBreakInstance(ULocale where, int kind)(Code)(Java Doc)
public static BreakIterator getCharacterInstance()(Code)(Java Doc)
public static BreakIterator getCharacterInstance(Locale where)(Code)(Java Doc)
public static BreakIterator getCharacterInstance(ULocale where)(Code)(Java Doc)
public static BreakIterator getLineInstance()(Code)(Java Doc)
public static BreakIterator getLineInstance(Locale where)(Code)(Java Doc)
public static BreakIterator getLineInstance(ULocale where)(Code)(Java Doc)
final public ULocale getLocale(ULocale.Type type)(Code)(Java Doc)
public static BreakIterator getSentenceInstance()(Code)(Java Doc)
public static BreakIterator getSentenceInstance(Locale where)(Code)(Java Doc)
public static BreakIterator getSentenceInstance(ULocale where)(Code)(Java Doc)
abstract public CharacterIterator getText()(Code)(Java Doc)
public static BreakIterator getTitleInstance()(Code)(Java Doc)
public static BreakIterator getTitleInstance(Locale where)(Code)(Java Doc)
public static BreakIterator getTitleInstance(ULocale where)(Code)(Java Doc)
public static BreakIterator getWordInstance()(Code)(Java Doc)
public static BreakIterator getWordInstance(Locale where)(Code)(Java Doc)
public static BreakIterator getWordInstance(ULocale 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 static Object registerInstance(BreakIterator iter, Locale locale, int kind)(Code)(Java Doc)
public static Object registerInstance(BreakIterator iter, ULocale locale, int kind)(Code)(Java Doc)
final void setLocale(ULocale valid, ULocale actual)(Code)(Java Doc)
public void setText(String newText)(Code)(Java Doc)
abstract public void setText(CharacterIterator newText)(Code)(Java Doc)
public static boolean unregister(Object key)(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(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.