mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-21 12:40:02 +00:00
Initial checkin: this application writes the .brk files for ICU.
X-SVN-Rev: 2455
This commit is contained in:
parent
c94f70ff6e
commit
6dead1ec6d
1 changed files with 53 additions and 0 deletions
53
icu4j/src/com/ibm/tools/RuleBasedBreakIterator/WriteTablesToFiles.java
Executable file
53
icu4j/src/com/ibm/tools/RuleBasedBreakIterator/WriteTablesToFiles.java
Executable file
|
@ -0,0 +1,53 @@
|
|||
/*
|
||||
*******************************************************************************
|
||||
* Copyright (C) 1996-2000, International Business Machines Corporation and *
|
||||
* others. All Rights Reserved. *
|
||||
*******************************************************************************
|
||||
*
|
||||
* $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/tools/RuleBasedBreakIterator/Attic/WriteTablesToFiles.java,v $
|
||||
* $Date: 2000/09/19 21:05:46 $
|
||||
* $Revision: 1.1 $
|
||||
*
|
||||
*****************************************************************************************
|
||||
*/
|
||||
package com.ibm.tools.RuleBasedBreakIterator;
|
||||
|
||||
import java.io.*;
|
||||
import com.ibm.text.*;
|
||||
|
||||
public class WriteTablesToFiles {
|
||||
public static void main(String[] args) throws IOException {
|
||||
writeBatch(true);
|
||||
writeBatch(false);
|
||||
}
|
||||
|
||||
public static void writeBatch(boolean littleEndian) throws IOException {
|
||||
BreakIterator bi;
|
||||
String suffix = (littleEndian ? "LE" : "BE");
|
||||
|
||||
bi = BreakIterator.getCharacterInstance();
|
||||
((RuleBasedBreakIterator)bi).writeTablesToFile(new FileOutputStream(
|
||||
"char" + suffix + ".brk"), littleEndian);
|
||||
|
||||
bi = BreakIterator.getWordInstance();
|
||||
((RuleBasedBreakIterator)bi).writeTablesToFile(new FileOutputStream(
|
||||
"word" + suffix + ".brk"), littleEndian);
|
||||
|
||||
bi = BreakIterator.getLineInstance();
|
||||
((RuleBasedBreakIterator)bi).writeTablesToFile(new FileOutputStream(
|
||||
"line" + suffix + ".brk"), littleEndian);
|
||||
|
||||
bi = BreakIterator.getSentenceInstance();
|
||||
((RuleBasedBreakIterator)bi).writeTablesToFile(new FileOutputStream(
|
||||
"sent" + suffix + ".brk"), littleEndian);
|
||||
|
||||
java.util.Locale thai = new java.util.Locale("th", "", "");
|
||||
bi = BreakIterator.getWordInstance(thai);
|
||||
((RuleBasedBreakIterator)bi).writeTablesToFile(new FileOutputStream(
|
||||
"word_th" + suffix + ".brk"), littleEndian);
|
||||
|
||||
bi = BreakIterator.getLineInstance(thai);
|
||||
((RuleBasedBreakIterator)bi).writeTablesToFile(new FileOutputStream(
|
||||
"line_th" + suffix + ".brk"), littleEndian);
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue