]> _ Git - cubist_pdf.git/commitdiff
wip #6188 @1
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 12 Sep 2023 19:23:58 +0000 (21:23 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 12 Sep 2023 19:23:58 +0000 (21:23 +0200)
resources/tools/fwstk/.idea/workspace.xml
resources/tools/fwstk/bin/com/fluidbook/fwstk/Main.class
resources/tools/fwstk/bin/com/fluidbook/fwstk/TextsThread.class
resources/tools/fwstk/bin/cube/util/StringUtil.class
resources/tools/fwstk/out/artifacts/fwstk_jar/fwstk.jar
resources/tools/fwstk/src/com/fluidbook/fwstk/Main.java
resources/tools/fwstk/src/com/fluidbook/fwstk/TextsThread.java
resources/tools/fwstk/src/cube/util/StringUtil.java

index a44232e26124d510cb840f5a6397dccc867a87e5..a5c00fffe4bffeed9127b976aa2afed69fffd9db 100644 (file)
@@ -9,9 +9,7 @@
     <option name="autoReloadType" value="SELECTIVE" />
   </component>
   <component name="ChangeListManager">
-    <list default="true" id="f146bc67-2578-4de3-9db2-94d2d43e9e83" name="Default" comment="wip #5410">
-      <change beforePath="$PROJECT_DIR$/../../../src/PDFTools.php" beforeDir="false" afterPath="$PROJECT_DIR$/../../../src/PDFTools.php" afterDir="false" />
-    </list>
+    <list default="true" id="f146bc67-2578-4de3-9db2-94d2d43e9e83" name="Default" comment="wip #5410" />
     <option name="SHOW_DIALOG" value="false" />
     <option name="HIGHLIGHT_CONFLICTS" value="true" />
     <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
       <workItem from="1694090487471" duration="6051000" />
       <workItem from="1694157597994" duration="9552000" />
       <workItem from="1694187452028" duration="14000" />
-      <workItem from="1694189811041" duration="112000" />
+      <workItem from="1694189811041" duration="768000" />
+      <workItem from="1694545035743" duration="798000" />
     </task>
     <task id="LOCAL-00001" summary="wip #1111 @0.5">
       <created>1487172253077</created>
index fbb40584d3f2888100541767723575c652ca0411..92e526bd3d0b9526a70a73c707cc00eb84734118 100644 (file)
Binary files a/resources/tools/fwstk/bin/com/fluidbook/fwstk/Main.class and b/resources/tools/fwstk/bin/com/fluidbook/fwstk/Main.class differ
index 3826c474c0e025c50b53719ac3feed34d1fa6be1..c17afc75efcadd0b0a2f29d42642836fc412ded5 100644 (file)
Binary files a/resources/tools/fwstk/bin/com/fluidbook/fwstk/TextsThread.class and b/resources/tools/fwstk/bin/com/fluidbook/fwstk/TextsThread.class differ
index 18ef6cf1243073a6ae5b7e424ad0177aae03c093..f28562f28a415de84dddf543cfc710c25e6a8a10 100644 (file)
Binary files a/resources/tools/fwstk/bin/cube/util/StringUtil.class and b/resources/tools/fwstk/bin/cube/util/StringUtil.class differ
index 5a27de68a29c9df95f34ffbe3c0906fdfcefd872..4fe3b9fa3ba61bfba9e9cc6d80693a0e6169064f 100644 (file)
Binary files a/resources/tools/fwstk/out/artifacts/fwstk_jar/fwstk.jar and b/resources/tools/fwstk/out/artifacts/fwstk_jar/fwstk.jar differ
index 5513ebabc5ade128b44eb838ca4292c1d05d5d55..e5fe176961f65af7754749f4c8869622df14d169 100644 (file)
@@ -138,7 +138,7 @@ public class Main {
                     threads = Integer.parseInt(args[i].trim());
                 } else if (args[i].trim().compareTo("--mode") == 0) {
                     i++;
-                    robust = args[i].trim() == "robust";
+                    robust = args[i].trim().equals("robust");
                 }
             }
 
index 5720ee048f61d1d06bb79bbe4251a57b103700f6..0c3de1c614f88581efe75dac5da62c9768bf9af7 100644 (file)
@@ -40,6 +40,9 @@ public class TextsThread extends Thread {
         this.docURL = docURL;
         this.method = method;
         this.robust = robust;
+        if(this.robust){
+            this.method="fluidbook";
+        }
 
         trimchars = new String[1];
         trimchars[0] = " ";
@@ -185,7 +188,7 @@ public class TextsThread extends Thread {
                 try {
                     LayoutStripper layoutStripper;
                     layoutStripper = new LayoutStripper();
-                    layoutStripper.setRobust(robust);
+                    layoutStripper.setRobust(this.robust);
                     layoutStripper.setIgnoredSeparators(ignoredSeparators);
                     layoutStripper.process((PDPage) doc.getDocumentCatalog().getAllPages().get(i - 1), i);
 
@@ -197,7 +200,8 @@ public class TextsThread extends Thread {
                     String fhfile = file.replaceFirst("%s", "fh");
 
                     fbtext = html2text(fbtext);
-                    if (robust) {
+                    System.out.println("this.robust :: "+this.robust);
+                    if (this.robust) {
                         fbtext=StringUtil.removeSpaces(fbtext);
                     }
 
@@ -207,7 +211,7 @@ public class TextsThread extends Thread {
                         out.write(fbtext);
                         out.close();
                         System.out.println("Save texts to "+fpfile);
-                        if (!robust) {
+                        if (!this.robust) {
                             String fbindex = text2index(fbtext);
                             out = new BufferedWriter(new OutputStreamWriter(
                                     new FileOutputStream(fifile), "UTF8"));
index 87bd06295411fe013e87047d20b88dba107513c0..74abfb8dff58d5c4b38c6f7c91de20041007c7fb 100644 (file)
@@ -1,6 +1,7 @@
 package cube.util;
 
 import cube.util.AsciiUtils;
+import org.apache.commons.lang3.StringUtils;
 
 import java.util.HashMap;
 
@@ -74,11 +75,7 @@ public class StringUtil {
     }
 
     public static String removeSpaces(String in) {
-        String res = in.replaceAll(
-                "[\\u2000-\\u20ff\\ufffd]",
-                "");
-
-        return res;
+        return StringUtils.deleteWhitespace(in).replaceAll("\\s+","");
     }
 
     public static String removeControl(String in) {