<HTML>
<HEAD>  </HEAD>

<BODY BGCOLOR=#FFFFFF>
<H2 ALIGN=center><I>Text Boundary Demo Guide</I></H2>

<blockquote>
<P><B>Caveat: </B> Many browsers do not seem to implement the TextArea select() function properly.  The only browser this applet fully works in is the HotJava 1.0 browser,.  On other browsers you may not see correct selection behavior. 
</P>
</blockquote>

<TABLE ALIGN=center WIDTH=100% CELLPADDING=10>
<TR>
<TD WIDTH=50% ALIGN=center> <APPLET codebase="../code" CODE="TextBoundDemo.class" WIDTH=55 HEIGHT=30 align=middle>(Java not enabled in this browser)</APPLET>
</TD>
</TR>
</TABLE>

<P> Text boundary analysis enables programs to provide more intelligent text selection and line-wrapping, based on the natural language of the text. All of the boundary detection functions demonstrated here use table-driven state machines for speed.</P> 

<P> This demo applet lets you cycle through consecutive occurrences of the types of text elements listed below.  Use the right or left arrow key to highlight the next or previous occurrence.  </P>

<P> <CENTER>
<A HREF="#sentences">Sentences</A>&nbsp;
<A HREF="#lines">Lines</A>&nbsp;
<A HREF="#words">Words</A>&nbsp;
<A HREF="#chars">Characters</A>
</CENTER> </P>

<HR>
<H3><A NAME="sentences">Sentences</A></H3>
<P>Many text editing applications allow the user to select sentences with a key combination or triple click.  The sentence selection mechanism demonstrated here is sensitive to the context of periods and other punctuation.  </P>
<TABLE WIDTH=100% CELLPADDING=5>
<TR><TH ALIGN=left VALIGN=bottom>To See This...</TH>
<TH ALIGN=left VALIGN=bottom>Do This...</TH>
</TR>
<TR>
<TD WIDTH=50% VALIGN=top> 
 Sentence selection with correct interpretation of periods within numbers and abbreviations, and trailing punctuation marks such as quotation marks and parentheses.</TD>
<TD VALIGN=top>
<TABLE CELLSPACING=0 CELLPADDING=0>
<TR>
<TD WIDTH=10 VALIGN=top> 1.
</TD>
<TD> Click at the beginning of the text
</TD>
</TR>
<TR>
<TD WIDTH=10 VALIGN=top> 2.
</TD>
<TD> Use the right arrow key to select sentences
</TD>
</TR>
</TABLE></TD></TR>
</TABLE>

<HR ALIGN=left WIDTH=50%>
<H3><A NAME="lines">Lines</A></H3>
<P>Line boundary analysis determines where a text string can be broken when line-wrapping.
</P>  
<TABLE WIDTH=100% CELLPADDING=5>
<TR>
<TH ALIGN=left VALIGN=bottom>To See This...</TH>
<TH ALIGN=left VALIGN=bottom>Do This...</TH>
</TR>
<TR>
<TD WIDTH=50% VALIGN=top>
Identification of places where lines could be broken if you needed to reflow the text.  The mechanism correctly handles punctuation and hyphenated words. 
</TD>
<TD VALIGN=top>
<TABLE CELLSPACING=0 CELLPADDING=0>
<TR>
<TD WIDTH=10 VALIGN=top> 1.
</TD>
<TD> Select <I>Line Break </I> from the Boundaries menu
</TD>
</TR>
<TR>
<TD WIDTH=10 VALIGN=top> 2.
</TD>
<TD> Click in the text
</TD>
</TR>
<TR>
<TD WIDTH=10 VALIGN=top> 3.
</TD>
<TD> Use the left or right arrow key to highlight line breakpoints
</TD>
</TR>
</TABLE>
</TD>
</TR>
</TABLE>
<P>Though not demonstrated here, the boundary mechanism also handles line breaks for non-Roman scripts.</P> 
<BR>

<HR ALIGN=left WIDTH=50%>
<H3><A NAME="words">Words</A></H3>
<P>Word boundary analysis is used by search and replace functions, as well as within text editing applications that allow the user to select words with a double click.   
</P>
<TABLE WIDTH=100% CELLPADDING=5>
<TR>
<TH ALIGN=left VALIGN=bottom>To See This...</TH>
<TH ALIGN=left VALIGN=bottom>Do This...</TH>
</TR>
<TR>
<TD WIDTH=50% VALIGN=top>
Word selection with correct interpretation of punctuation marks within and following words.  Characters that are not part of a word, such as symbols or punctuation marks, have word-breaks on both sides.
</TD>
<TD VALIGN=top>
<TABLE CELLSPACING=0 CELLPADDING=0>
<TR>
<TD WIDTH=10 VALIGN=top> 1.
</TD>
<TD> Select <I>Word </I> from the Boundaries menu
</TD>
</TR>
<TR>
<TD WIDTH=10 VALIGN=top> 2.
</TD>
<TD> Click in the text
</TD>
</TR>
<TR>
<TD WIDTH=10 VALIGN=top> 3.
</TD>
<TD> Use the left or right arrow key to select words
</TD>
</TR>
</TABLE>
</TD>
</TR>
</TABLE>

<HR ALIGN=left WIDTH=50%>
<H3><A NAME="chars">Characters</A></H3>
<P>Character boundary analysis allows users to interact with characters as they expect to, for example, when moving the cursor through a text string.    
</P>

<TABLE WIDTH=100% CELLPADDING=5>
<TR>
<TH ALIGN=left VALIGN=bottom>To See This...</TH>
<TH ALIGN=left VALIGN=bottom>Do This...</TH>
</TR>
<TR>
<TD WIDTH=50% VALIGN=top>
Correct navigation of the cursor through character strings, regardless of how the character is stored.  For example, an accented character might be stored as a base character and a diacritical mark.  What users consider to be a character can differ between languages.
</TD>
<TD VALIGN=top>
<TABLE CELLSPACING=0 CELLPADDING=0>
<TR>
<TD WIDTH=10 VALIGN=top> 1.
</TD>
<TD> Select <I>Char </I> from the Boundaries menu
</TD>
</TR>
<TR>
<TD WIDTH=10 VALIGN=top> 2.
</TD>
<TD> Click in the text
</TD>
</TR>
<TR>
<TD WIDTH=10 VALIGN=top> 3.
</TD>
<TD> Use the left or right arrow key to move from character to character
</TD>
</TR>
</TABLE>
</TD>
</TR>
</TABLE>

<P>Though not demonstrated here, the boundary detection mechanism can handle Hangul and Indic syllables as well as characters followed by non-spacing accents and diacritics.  
</P>
<P> You can also type other text into the applet window to see selection of different boundaries.  Try it out!
</P>


<HR> <BR>
<a href="../code/TextBoundDemo.java">The source.</a>
<p>

<HR>
<BR><a href="http://www.taligent.com/Copyright.html">&copy; Copyright 
1997</a>. All rights reserved. Taligent, Inc., IBM Corp.

</BODY>
</HTML>
