Mercurial > hg > Members > nobuyasu > TestNeo4j
changeset 17:e30f2714686b draft
fix CharReader.java
author | one |
---|---|
date | Thu, 23 Aug 2012 17:36:46 +0900 |
parents | 5c8c554ee3ac |
children | 7e4aa7037c7c |
files | src/howtouse/CharReader.java src/wikigraph/LinkConvertGraph.java |
diffstat | 2 files changed, 11 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- a/src/howtouse/CharReader.java Thu Aug 23 09:03:33 2012 +0900 +++ b/src/howtouse/CharReader.java Thu Aug 23 17:36:46 2012 +0900 @@ -12,16 +12,8 @@ private final char LBRANK = '['; private final char RBRANK = ']'; private final char VERBAR = '|'; + private final char COLON= ':'; - private final static int LETTER = 1; - private final static int[] charKindT = new int[0x10000]; - static { - for (int i = 0; i < 'A'; i++) - charKindT[i] = 0; - for (int i = 'A'; i <= 'Z'; i++) - charKindT[i] = LETTER; - - } CharReader() { } @@ -67,8 +59,11 @@ nextState = 4; } else if (ch == VERBAR) { index = buf.length(); - buf.append(ch); -// buf.delete(0,buf.length()); + buf.append(ch); + return buf.substring(0,index); + } else if (ch == COLON) { + index = 0; + buf.delete(0,buf.length()); } else { buf.append(ch); }
--- a/src/wikigraph/LinkConvertGraph.java Thu Aug 23 09:03:33 2012 +0900 +++ b/src/wikigraph/LinkConvertGraph.java Thu Aug 23 17:36:46 2012 +0900 @@ -87,12 +87,16 @@ lcg.parseXml(); + + +/* final String logFile = "./resource/log2.txt"; FileOutputStream os = new FileOutputStream(logFile); lcg.printHash(os); os.close(); -// lcg.printHash(); +*/ + lcg.printHash(); } catch (FileNotFoundException e) {