summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoe Robinson <joe@lc8n.com>2010-10-31 23:39:37 +0000
committerJoe Robinson <joe@lc8n.com>2010-10-31 23:39:37 +0000
commitaa2c30e3ec543efb84d2557c43747544c93efad5 (patch)
tree986046997d545e28c63b2deff6249a41f6156f9b
parent1e27bc809711659757f8f4a94858d4a42f284def (diff)
Outputs on a single line, sends exit code 1 if no result was found
-rw-r--r--bladictionary.java23
1 files changed, 20 insertions, 3 deletions
diff --git a/bladictionary.java b/bladictionary.java
index 9f177af..403c821 100644
--- a/bladictionary.java
+++ b/bladictionary.java
@@ -40,8 +40,7 @@ public class bladictionary {
Boolean definition = false;
Boolean definition2 = false;
Boolean wn = false;
- String[] defLines = new String[50];
- int i = 0;
+ String result = "";
//Read every line
while ((line = br.readLine()) != null)
{
@@ -88,7 +87,14 @@ public class bladictionary {
{
parts = line.split("\\[");
- System.out.println(parts[0]);
+ if (result.equals(""))
+ {
+ result = parts[0];
+ }
+ else
+ {
+ result = result + "; "+ parts[0];
+ }
}
else
{
@@ -100,6 +106,17 @@ public class bladictionary {
}
}
}
+
+ if(!result.equals(""))
+ {
+ System.out.println(result);
+ System.exit(0);
+ }
+ else
+ {
+ System.exit(1);
+ }
+
}
} \ No newline at end of file