Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / December 2007

Tip: Looking for answers? Try searching our database.

About the BreakIterator Class (getLineInstance( ) Function )

Thread view: 
Abhishek - 17 Dec 2007 06:03 GMT
Hello,

has anyone used the breakiterator class and specifically the
LineInstance function in java?
Is it possible to specify any delimiters for the LineInstance function
while it tries to break entities into lines?

it breaks words like P-2345 into P- and 2345 as two separate line
entities. Is it possible for us to specify that it is a single entity?
Thanks

Abhishek S
Stefan Ram - 17 Dec 2007 07:15 GMT
>Is it possible for us to specify that it is a single entity?

 You need to provide a suitably instance of

http://download.java.net/jdk7/docs/api/java/util/Locale.html

 . To supply an custom locale, install a custom

http://download.java.net/jdk7/docs/api/java/util/spi/LocaleServiceProvider.html

 .
Stefan Ram - 17 Dec 2007 07:35 GMT
Supersedes: <Locale-20071217081455@ram.dialup.fu-berlin.de>

>it breaks words like P-2345 into P- and 2345 as two separate line
>entities. Is it possible for us to specify that it is a single entity?

 Superseding my previous answer:

 I am not sure about this.

 There seems to be the possibility to install a custom
 java.text.spi.BreakIteratorProvider, or a custom
 java.util.spi.LocaleServiceProvider.

 One of them possibly can be specified to regard »-« to be
 an in-word character.

 However, I have never done this and I don't know the
 details.
Stefan Ram - 17 Dec 2007 07:58 GMT
>There seems to be the possibility to install a custom
>java.text.spi.BreakIteratorProvider, or a custom
>java.util.spi.LocaleServiceProvider.

 See also:

http://java.sun.com/docs/books/tutorial/i18n/locale/services.html


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.