/*
******************************************************************************
-* Copyright (C) 2007, International Business Machines Corporation and *
+* Copyright (C) 2007-2012, International Business Machines Corporation and *
* others. All Rights Reserved. *
******************************************************************************
*/
return new String(buf, x, w-x);
}
- public static void main(String[] args) {
- for (int i = 0; i < args.length; ++i) {
- String arg = args[i];
- System.out.print(arg);
- System.out.print(" > ");
- long n = Long.parseLong(arg);
- System.out.println(chineseNumber(n, ChineseDigits.DEBUG));
- }
- }
+// public static void main(String[] args) {
+// for (int i = 0; i < args.length; ++i) {
+// String arg = args[i];
+// System.out.print(arg);
+// System.out.print(" > ");
+// long n = Long.parseLong(arg);
+// System.out.println(chineseNumber(n, ChineseDigits.DEBUG));
+// }
+// }
public static class ChineseDigits {
final char[] digits;
/*
*******************************************************************************
- * Copyright (C) 1996-2010, International Business Machines Corporation and *
+ * Copyright (C) 1996-2012, International Business Machines Corporation and *
* others. All Rights Reserved. *
*******************************************************************************
*/
//=================================================================================
// testing and debugging
//=================================================================================
+
+// public static void main(String... args) {
+// String inFile = args[0];
+// String outFile = args.length >= 2 ? args[1] : null;
+// try {
+// writeToFile(inFile, outFile);
+// } catch (Exception e) {
+// e.printStackTrace();
+// }
+// }
+
///CLOVER:OFF
- //The main method looks like it was useful once but now seems worthless. It is not used by any method or class.
- public static void main(String args[])
+ static void writeToFile(String inFile, String outFile)
throws FileNotFoundException, UnsupportedEncodingException, IOException {
- String filename = args[0];
- BreakDictionary dictionary = new BreakDictionary(new FileInputStream(filename));
+ BreakDictionary dictionary = new BreakDictionary(new FileInputStream(inFile));
PrintWriter out = null;
- if(args.length >= 2) {
- out = new PrintWriter(new OutputStreamWriter(new FileOutputStream(args[1]), "UnicodeLittle"));
+ if(outFile != null) {
+ out = new PrintWriter(new OutputStreamWriter(new FileOutputStream(outFile), "UnicodeLittle"));
}
dictionary.printWordList("", 0, out);