This repository has been archived by the owner on Feb 23, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path_config.lua
103 lines (86 loc) · 3.39 KB
/
_config.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
--[[
greedy-ocr
Original Work Copyright (c) 2015 Sebastian Spaar
------------------------------------------------------------------------
_config.lua
]]
local config = {}
-- Debug flag.
config.DEBUG = true
-- Activate or deactivate lexicon/bigram lookup.
config.use_lexicon = true
config.use_bigram = true
-- The location of the lexicon and corpus file.
-- The lexicon file is needed for the lexicon lookup,
-- the corpus file for the bigram.
config.lexicon_filename = "_share/lexicon_until_april.txt"
config.corpus_filename = "_share/mercurius_until_april.txt"
-- Name of the folders containing Prototypes/the image to be recognized.
config.prototypes_directory = "_prototypes"
config.pages_directory = "_pages"
-- If this flag is set to true, greedy-ocr tries to split Segments
-- into smaller Components according to the white pixels between
-- letters.
config.automatically_split_segments = true
-- The minimum width for a Component to be created.
config.MINIMUM_COMPONENT_WIDTH = 10
-- These thresholds define when a Component may be splitted by a
-- Prototype.
config.SPLIT_THRESHOLD = 0.75
config.HIGH_SPLIT_THRESHOLD = 0.82
config.VERY_HIGH_SPLIT_THRESHOLD = 0.85
-- Specify those letters that need a high/very high confidence.
config.high_confidence = {
u = true, r = true, m = true, n = true, d = true, o = true, a = true
}
config.very_high_confidence = {
l = true, e = true, i = true, t = true, c = true
}
-- The ranking of Prototypes. Prototypes at the beginning of this list
-- will get sorted before others.
config.prototype_ranking = {
"h", "b", "d", "u", "m", "n", "r", "o", "l", "i", "c", "t"
}
-- Specify those Prototypes that should not create a cluster image,
-- because of different types (Fraktur/Antiqua), for instance.
config.separate_clusters = {s = true, st = true, v = true}
-- Use this list to create new Prototypes from image files that cannot
-- be automatically generated by `load_prototypes()' in `setup.lua'.
-- Format: {"Prototype letter", "path/to/image.png"}
config.additional_prototypes = {
{"ä", "_prototypes/_a_u.png"},
{"ä", "_prototypes/_a_u_2.png"},
{"ö", "_prototypes/_o_u.png"},
{"A", "_prototypes/_a_c_2.png"},
{"B", "_prototypes/_b_c_2.png"},
{"B", "_prototypes/_b_c_3.png"},
{"D", "_prototypes/_d_c_2.png"},
{"D", "_prototypes/_d_c_3.png"},
{"F", "_prototypes/_f_c_2.png"},
{"F", "_prototypes/_f_c_3.png"},
{"G", "_prototypes/_g_c_2.png"},
{"H", "_prototypes/_h_c_2.png"},
{"H", "_prototypes/_h_c_3.png"},
{"H", "_prototypes/_h_c_4.png"},
{"K", "_prototypes/_k_c_2.png"},
{"K", "_prototypes/_k_c_3.png"},
{"L", "_prototypes/_l_c_2.png"},
{"L", "_prototypes/_l_c_3.png"},
{"P", "_prototypes/_p_c_2.png"},
{"S", "_prototypes/_s_c_2.png"},
{"T", "_prototypes/_s_c_2.png"},
{"Sch", "_prototypes/_Sch_c.png"},
{"Sch", "_prototypes/_Sch_c_2.png"},
}
-- Specify punctuation Prototypes. Not currently implemented.
config.punctuation = {["."] = true, ["-"] = true, ["/"] = true}
-- A component is regarded unknown if its string is one of the following
config.UNKNOWN_COMPONENTS = {[".*"] = true, [".+"] = true, ["."] = true, [".?"] = true}
-- Colors.
config.BACKGROUND_COLOR = {127, 127, 127}
config.FONT_COLOR = {150, 152, 150}
config.HUD_COLOR = {66, 66, 66}
config.HUD_LINE_COLOR = {42, 42, 42}
config.SEGMENT_COLOR = {213, 78, 83}
config.COMPONENT_COLOR = {122, 166, 218}
return config