From c20e56ca65ae618211fe50c293883316ea4642d6 Mon Sep 17 00:00:00 2001 From: "Jan R.I. B.F. v.W. v.Z. (faerietree)" Date: Thu, 16 Mar 2017 03:42:33 +0100 Subject: [PATCH] Core: WordSearch: Split into words without empties by splitting on one or more spaces inbetween. --- src/aufgaben_db/MethodenWortSuche.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/aufgaben_db/MethodenWortSuche.java b/src/aufgaben_db/MethodenWortSuche.java index 8c04d5f..e40af8a 100755 --- a/src/aufgaben_db/MethodenWortSuche.java +++ b/src/aufgaben_db/MethodenWortSuche.java @@ -74,7 +74,7 @@ public static String sucheErstesWortImDoc(String[] filename) { String zeile = ersetzeSzUndUmLeer(filename[i]); System.out.println(zeile); // Split into words|word chunks: - String[] array = zeile.split("\\s"); + String[] array = zeile.split("\\s+"); // First word fragment made of > 3 connected chars: for (int j = 0; j < array.length; j++) { @@ -111,7 +111,7 @@ public static String sucheLetztesWortImDoc(String[] raw_content) { String zeile = ersetzeSzUndUmLeer(line); // Split into words|word chunks: - String[] array = zeile.split("\\s"); + String[] array = zeile.split("\\s+"); for (int j = array.length - 1; j > -1; j--) { String w = array[j];