How to wrap a long word to fit a web page layout using grammatical rules?
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Raja_Raman
Posted On:   Thursday, June 26, 2003 04:59 AM

I'm working on a globalized web-based application. The page HTML has a fixed width for each column. The same HTMLs are used to display a page in various languages, currently - English, German, Scandic languages and Japanese. The problem is this: Certain words (currently seen only in German and Finnish) are extremely long - and exceed the width provided on the page. As they don't have any space or hyphen or other punctuation marks, the word doesn't break - instead expands layout of its column, breaking layout of the entire page. One option for me is to break each string, regardless of the context, after "n" characters (n = width of the layout). This has one key disadvantage - it doesn't respect grammatical rule   More>>

I'm working on a globalized web-based application. The page HTML has a fixed width for each column. The same HTMLs are used to display a page in various languages, currently - English, German, Scandic languages and Japanese.



The problem is this: Certain words (currently seen only in German and Finnish) are extremely long - and exceed the width provided on the page. As they don't have any space or hyphen or other punctuation marks, the word doesn't break - instead expands layout of its column, breaking layout of the entire page.



One option for me is to break each string, regardless of the context, after "n" characters (n = width of the layout). This has one key disadvantage - it doesn't respect grammatical rules for breaking words in between. For example, a German word Heuschrecke, if needed to be broken between 'c' and 'k' in terms of width, will look like:
Heuschrec-ke. However, according to the rules of German language, this must look like: Heuschrek-ke. Currently, I looked at BreakIterator and other Java API, but there's nothing that conforms to the rules of a particular locale. Is there any way around this? We're happy if we even get to breaking around syllables (as opposed to perfect adherence to grammatical rules like the spelling change above). Please advise.



Thanks,



Raja

   <<Less
About | Sitemap | Contact