From a60f6020657e1da836969909b808cb86adf91389 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubom=C3=ADr=20Kr=C4=8Dm=C3=A1=C5=99?= Date: Tue, 28 Oct 2014 15:49:53 +0100 Subject: [PATCH] colon as file separator replaced by semicolon --- .../edu/ucla/sspace/mains/OptionDescriptions.java | 4 ++-- .../java/edu/ucla/sspace/text/TokenFilter.java | 14 +++++++------- .../edu/ucla/sspace/text/TokenFilterTests.java | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/main/java/edu/ucla/sspace/mains/OptionDescriptions.java b/src/main/java/edu/ucla/sspace/mains/OptionDescriptions.java index 4222c404..d916ec2e 100644 --- a/src/main/java/edu/ucla/sspace/mains/OptionDescriptions.java +++ b/src/main/java/edu/ucla/sspace/mains/OptionDescriptions.java @@ -70,12 +70,12 @@ private OptionDescriptions() { } "included or\n" + "excluded. The behavior, \"include\" or \"exclude\" is specified\n" + "first, followed by one or more file names, each separated by " + - "colons.\n" + + "semicolons.\n" + "Multiple behaviors may be specified one after the other using a ','\n"+ "character to separate them. For example, a typical configuration " + "may\n" + "look like: " + - "include=top-tokens.txt:test-words.txt,exclude=stop-words.txt\n" + + "include=top-tokens.txt;test-words.txt,exclude=stop-words.txt\n" + "Note that behaviors are applied in the order they are presented on the " + "command-line."; diff --git a/src/main/java/edu/ucla/sspace/text/TokenFilter.java b/src/main/java/edu/ucla/sspace/text/TokenFilter.java index 7154cb9a..d87b0c1c 100644 --- a/src/main/java/edu/ucla/sspace/text/TokenFilter.java +++ b/src/main/java/edu/ucla/sspace/text/TokenFilter.java @@ -60,7 +60,7 @@ * chain of filters from a text configuration. This is intended to facility * command-line tools that want to provide easily configurable filters. An * example configuration might look like: - * include=top-tokens.txt:test-words.txt,exclude=stop-words.txt + * include=top-tokens.txt;test-words.txt,exclude=stop-words.txt * * @see FilteredIterator */ @@ -160,10 +160,10 @@ public TokenFilter combine(TokenFilter parent) { * * A configuration lists sets of files that contain tokens to be included or * excluded. The behavior, {@code include} or {@code exclude} is specified - * first, followed by one or more file names, each separated by colons. + * first, followed by one or more file names, each separated by semicolons. * Multiple behaviors may be specified one after the other using a {@code ,} * character to separate them. For example, a typicaly configuration may - * look like: "include=top-tokens.txt,test-words.txt:exclude=stop-words.txt" + * look like: "include=top-tokens.txt;test-words.txt,exclude=stop-words.txt" * Note behaviors are applied in the order they are presented on the * command-line. * @@ -186,10 +186,10 @@ public static TokenFilter loadFromSpecification(String configuration) { * * A configuration lists sets of files that contain tokens to be included or * excluded. The behavior, {@code include} or {@code exclude} is specified - * first, followed by one or more file names, each separated by colons. + * first, followed by one or more file names, each separated by semicolons. * Multiple behaviors may be specified one after the other using a {@code ,} * character to separate them. For example, a typicaly configuration may - * look like: "include=top-tokens.txt,test-words.txt:exclude=stop-words.txt" + * look like: "include=top-tokens.txt;test-words.txt,exclude=stop-words.txt" * Note behaviors are applied in the order they are presented on the * command-line. * @@ -207,7 +207,7 @@ public static TokenFilter loadFromSpecification(String configuration, TokenFilter toReturn = null; - // multiple filter are separated by a ':' + // multiple filter are separated by a ';' String[] filters = configuration.split(","); for (String s : filters) { @@ -223,7 +223,7 @@ public static TokenFilter loadFromSpecification(String configuration, throw new IllegalArgumentException( "Invalid filter behavior: " + behavior); - String[] files = optionAndFiles[1].split(":"); + String[] files = optionAndFiles[1].split(";"); // Load the words in the file(s) Set words = new HashSet(); diff --git a/src/test/java/edu/ucla/sspace/text/TokenFilterTests.java b/src/test/java/edu/ucla/sspace/text/TokenFilterTests.java index cfcfbd5c..380d68ca 100644 --- a/src/test/java/edu/ucla/sspace/text/TokenFilterTests.java +++ b/src/test/java/edu/ucla/sspace/text/TokenFilterTests.java @@ -57,7 +57,7 @@ public class TokenFilterTests { @Test public void testMultipleInclude() throws IOException { File toInclude = createFileWithText("include\nthree\nwords"); File toInclude2 = createFileWithText("foo\nbar\nbaz"); - String filterSpec = "include=" + toInclude.getAbsolutePath() + ":" + String filterSpec = "include=" + toInclude.getAbsolutePath() + ";" + toInclude2.getAbsolutePath(); TokenFilter filter = TokenFilter.loadFromSpecification(filterSpec); assertTrue(filter.accept("include"));