lets-read project

This commit is contained in:
2022-06-25 17:18:19 +00:00
parent 736a1982b4
commit 138897008e
6 changed files with 88 additions and 0 deletions

View File

@@ -0,0 +1,11 @@
package lets_read;
import kiss.Kiss;
import kiss.Prelude;
import sys.FileSystem;
import sys.io.File;
using hx.strings.Strings;
using haxe.io.Path;
@:build(kiss.Kiss.build())
class Main {}

View File

@@ -0,0 +1,25 @@
(var THRESHOLD 0.4)
```
echo "\$(pwd)" > g.txt
echo "$(Sys.getCwd)" > g.txt
```
(assertLet [[folder realCwd] (Sys.args)
folder (joinPath realCwd folder)
files (reverse (FileSystem.readDirectory folder))
lastFrame (first files)]
```
cd $folder && tesseract $lastFrame $(lastFrame.withoutExtension)
```
(doFor [after before] (pairs files)
```
cd $folder && tesseract $before $(Path.withoutExtension before)
```
(let [afterText (File.getContent "${folder}/$(Path.withoutExtension after).txt")
beforeText (File.getContent "${folder}/$(Path.withoutExtension before).txt")]
(when (or !beforeText
(< THRESHOLD (kiss.FuzzyMap.fuzzyMatchScore afterText beforeText)))
```
cd $folder && rm $before
```))))