java.lang.Object
java.text.BreakIterator
- All Implemented Interfaces:
- Cloneable
- See Also:
- Top Examples, Source Code,
CharacterIterator
protected BreakIterator()
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public Object clone()
- See Also:
Cloneable
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public abstract int current()
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public static final int DONE
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public abstract int first()
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
[80]Break string into sentences
By Anonymous on 2003/06/16 19:53:21 Rate
import java.text.BreakIterator;
public class BreakDemo1 {
public static void main ( String args [ ] ) {
// string to be broken into sentences
String str = "\"Testing.\" \"???\"
( This is a test. ) ";
// create a sentence break iterator
BreakIterator brkit =
BreakIterator.getSentenceInstance ( ) ;
brkit.setText ( str ) ;
// iterate across the string
int start = brkit.first ( ) ;
int end = brkit.next ( ) ;
while ( end != BreakIterator.DONE ) {
String sentence = str.substring (
start, end ) ;
System.out.println ( start + " " +
sentence ) ;
start = end;
end = brkit.next ( ) ;
}
}
}
public abstract int following(int offset)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public static Locale[] getAvailableLocales()
- See Also:
Locale.US
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public static BreakIterator getCharacterInstance()
- See Also:
Locale.getDefault()
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public static BreakIterator getCharacterInstance(Locale where)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
protected static int getInt(byte[] buf,
int offset)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public static BreakIterator getLineInstance()
- See Also:
Locale.getDefault()
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public static BreakIterator getLineInstance(Locale where)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
protected static long getLong(byte[] buf,
int offset)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public static BreakIterator getSentenceInstance()
- See Also:
Locale.getDefault()
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public static BreakIterator getSentenceInstance(Locale where)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
protected static short getShort(byte[] buf,
int offset)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public abstract CharacterIterator getText()
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public static BreakIterator getWordInstance()
- See Also:
Locale.getDefault()
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public static BreakIterator getWordInstance(Locale where)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public boolean isBoundary(int offset)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public abstract int last()
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public abstract int next()
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public abstract int next(int n)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public int preceding(int offset)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public abstract int previous()
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public void setText(String newText)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public abstract void setText(CharacterIterator newText)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples