chiark / gitweb /
Renames and cleanups.
[ypp-sc-tools.db-test.git] / pctb / yppsc-ocr-resolver
similarity index 97%
rename from pctb/show-thing.tcl
rename to pctb/yppsc-ocr-resolver
index 5356c3292c7c58a276944752d6b16c325b1f5090..016a95e58bfc90557e370ca7c36728dca32a0531 100755 (executable)
@@ -261,7 +261,7 @@ proc recursor//01 {z1} {
     .d.csr.csr.l configure -text {adjust}
     place .d.csr.csr -x [expr {$cur*$mul - 7}]
     bind_key space { othercursor }
-    bind_leftright cur_$z1 0 [expr {$cols-1}]
+    bind_leftright_q cur_$z1 0 [expr {$cols-1}]
     if {[llength $glyphsdone]} {
        bind_key Tab { set cur_mode already; recursor }
     } else {
@@ -279,6 +279,7 @@ proc recursor//01 {z1} {
        {Space     {switch to moving other cursor}}
        {Return    {confirm location, enter letter(s)}}
        {Tab       {switch to correcting earlier ocr}}
+       {Q         {quit and abandon OCR run}}
     }
 }
 proc othercursor {} {
@@ -320,7 +321,7 @@ proc recursor/already {} {
     place .d.csr.csr -x [expr {$rmax*$mul-3}]
     bind_key Return {}
     bind_key space {}
-    bind_leftright cur_already 0 [expr {[llength $glyphsdone]/4-1}]
+    bind_leftright_q cur_already 0 [expr {[llength $glyphsdone]/4-1}]
     bind_key Tab { bind_key Delete {}; set cur_mode 1; recursor }
     bind_key Delete {
        RETURN_RESULT DELETE [lrange $glyphsdone \
@@ -331,6 +332,7 @@ proc recursor/already {} {
        {{<- ->}   {move cursor, selecting glyph to correct}}
        {Del       {clear this glyph from the recognition database}}
        {Tab       {switch to selecting area to define as new glyph}}
+       {Q         {quit and abandon OCR run}}
     }
 }
 
@@ -344,9 +346,13 @@ proc unbind_all_keys {} {
     foreach k [array names keybindings] { bind_key $k {} }
 }
 
-proc bind_leftright {var min max} {
+proc bind_leftright_q {var min max} {
     bind_key Left  [list leftright $var $min $max -1]
     bind_key Right [list leftright $var $min $max +1]
+    bind_key q     {
+       puts stderr "\nCharacter resolver quitting as you requested."
+       exit 1
+    }
 }
 proc leftright {var min max inc} {
     upvar #0 $var v