From 8cfa513418ec09d6ddacb7ba0b2237dfe890de33 Mon Sep 17 00:00:00 2001 From: Joe Robinson Date: Thu, 4 Nov 2010 14:55:52 +0000 Subject: Various cleanups, should hopefully remove anything in brackets, even when split over multiple lines --- bladictionary.java | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/bladictionary.java b/bladictionary.java index b2e64da..b68d907 100644 --- a/bladictionary.java +++ b/bladictionary.java @@ -108,9 +108,7 @@ public class bladictionary { if(Character.isLetter(line.charAt(0))) { - - parts = line.split("\\["); - result = result + parts[0] + " "; + result = result+line+" "; } else { @@ -123,6 +121,8 @@ public class bladictionary { { //Delete bits in <>s, don't need this line = line.replaceAll("<.*?> ",""); + + line = line.replaceAll(" \\/.*?\\/ ",""); //Get rid of {}s around words line = line.replaceAll("\\{",""); line = line.replaceAll("\\}",""); @@ -141,7 +141,7 @@ public class bladictionary { else { definition2 = false; - result = result + parts[0]; + result = result + parts[0] + " "; } } else @@ -158,6 +158,13 @@ public class bladictionary { if(!result.equals("")) { + result = result.replaceAll("\\(.*?[;\\)] ?",""); + result = result.replaceAll("\\{.*?[;\\}] ?",""); + result = result.replaceAll("\\[.*?[;\\]] ?",""); + result = result.replaceAll("\\/.*?[;\\/] ?",""); + + result = result.split("\\[")[0]; + result = result.trim()+";"; System.out.println(result); System.exit(0); -- cgit v1.2.3