-
Notifications
You must be signed in to change notification settings - Fork 7
/
config.py
118 lines (101 loc) · 5.49 KB
/
config.py
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
from helper_classes import BigramsConfig
# This is the main thing you want to change.
# name: What you call the language. Could be anything.
# weight: The percentage of how important this language is. Make sure all weights add up to exactly 100(%).
# path: The path to your bigrams-file.
BIGRAMS_CONFIGS = (
BigramsConfig(
name = "English", weight = 100, # %
path = './bigram_dictionaries/english_bigrams.txt'
),
BigramsConfig(
name = "German", weight = 0, # %
path = './bigram_dictionaries/german_bigrams.txt'
),
BigramsConfig(
# When using 0%, no optimization will be done using this language.
# However, you will still be shown stats on how good this layout performs in this language.
name = "French", weight = 0, # %
path = './bigram_dictionaries/french_bigrams.txt'
),
)
# The number of letters from the 1st and 2nd layers that are interchangable
# This only affects the (n) least frequent letters of layer 1 and the (n) most frequent letters of layer 2
# /!\ BIG PERFORMANCE IMPACT /!\
# (0 - fastest, 8 - slowest)
AUTO_LAYER_SWAP_COUNT = 3
# The number of slots that will be kept empty
# Can be used to reserve room for special symbols such as period, comma, etc.
AUTO_LAYER_EMPTY_COUNT = 6
# Characters that will be ignored when generating layers from bigram-files
# Symbols available in the default 8VIM layout
AUTO_LAYER_IGNORE = ' !"#$%&\'()*+,-./0123456789:;<=>?@[\\]^_`{|}~¡¢£¦§©¬®°¶¿÷€₹™⨯'
# Whether the most common character should be fixed at the bottom-right of all layouts.
# If `True, this option fills up the first slot of `FIXATED_LETTERS`, creating less redundant results.
# Set to `False` if your scoring-system cares about layouts' orientation.
FIXATE_MOST_COMMON_LETTER = True
# Manually define the letters you want to use
# This removes all AUTO_LAYER functionality
MANUALLY_DEFINE_LAYERS = False
LAYER_1_LETTERS = 'etaoinsr'.lower() # All letters for the first cycleNr of calculation, including 'e' (or whatever you put in >staticLetters<)
LAYER_2_LETTERS = 'hldcumfg'.lower() # All letters for the second cycleNr of calculation
LAYER_3_LETTERS = 'pwybvkjx'.lower() # All letters for the third cycleNr of calculation
LAYER_4_LETTERS = 'zq'.lower() # All letters for the fourth cycleNr of calculation
# Define which of the above letters are interchangeable (variable) between adjacent layers.
# They have to be in the same order as they appear between layer1letters and layer2letters.
# This has a drastic effect on performance. Time for computation skyrockets. This is where the "======> 2 out of X cycleNrs" come from.
VAR_LETTERS_L1_L2 = 'nsrhld'.lower()
#VAR_LETTERS_L1_L2 = ''.lower()
# For layer 1, define that a certain Letter ('e') doesn't change.
# Just pick the most common one in your language.
# You can set it to other letters as well, it doesn't change anything about the quality of the layouts though.
# IF 'e' IS NOT IN YOUR INNERMOST LAYER, PUT ANOTHER LETTER WHERE 'e' IS!!
# ---
# If your rating-system cares about which way layouts are rotated,
# remove 'e' and use {LETTERS_PER_LAYER} empty strings.
FIXATED_LETTERS = ('e', '', '', '', '', '', '', '') # the positions go clockwise. 'e' is on the bottom left.
#FIXATED_LETTERS = ('', '', '', '', '', '', '', '')
# Define how many layers the layouts you recieve should contain.
NR_OF_LAYERS = 4
# Define how many of the best layer-versions should be used to generate the next layer's layouts.
# This improves Layouts but has a HUGE impact on performance, so be careful.
NR_OF_BEST_LAYOUTS = 500
# Define whether to add a greedy optimization after layers 3 and 4 (recommended)
PERFORM_GREEDY_OPTIMIZATION = True
# Define what information you want to recieve.
SHOW_DATA = True
SHOW_GENERAL_STATS = True
SHOW_TOP_LAYOUTS = 5
TEST_CUSTOM_LAYOUTS = True
CUSTOM_LAYOUTS = (
('Old / original 8VIM layout (flipped/rotated)', 'ayrbxp-q stdcgz-- iehljk-- onumvfw-'.lower()),
('Glitchys original best layout (flipped/rotated)', 'rsbojv-- ntmlfy-- aecdpk-q iuhgzw-x'.lower()),
('kjoetoms layout 1', 'rsgujb-- ntkmvy-- oecdpz-q iahlwf-x'.lower()),
('kjoetoms layout 2', 'dslfjg-- nhucvy-- oemtpz-- iawrkbqx'.lower()),
('kjoetoms layout 3', 'tcimjb-- nhuoky-- aepdfv-- rslgzwqx'.lower()),
# primary rotated version
('Old / original 8VIM layout', 'nomufv-w eilhkj-- tscdzg-- yabrpxq-'.lower()),
('Glitchys original best layout', 'uighwzx- eadckpq- tnlmyf-- srobvj--'.lower()),
#('Example Layout', 'ghopwx-- abijqryz cdklst-- efmnuv--'.lower()),
)
# Unless you're trying out a super funky layout with more (or less) than 4 sectors, this should be 8.
LETTERS_PER_LAYER = 8
# If for some reason your terminal does not support Unicode you can set this to True
DISABLE_UNICODE = False
# Ignore this variable:
DEBUG_MODE = False
# Use Multiprocessing (disable this when using `pypy3 main.py`)
USE_MULTIPROCESSING = False
# Use CFFI for better performance. Before running `pypy3 main.py`,
# execute this to compile the C(FFI) extension:
# `cd cffi && pypy3 cffi_extension_build.py`
# (compiler like gcc or clang required)
USE_CFFI = False
# Symbol used for filling up layer 4. If your alphabet or your bigram-list for some reason contains "-", change "-" to something else.
FILL_SYMBOL = '-'
# Ignore this option.
SCREEN_WIDTH = 100
# The rating-system you want to use. To use a different list of scores,
# replace "KJOETOM_SCORE_LIST" by something else which can be found in
# the `score_list.py`-file.
from score_lists import ORIGINAL_SCORE_LIST as SCORE_LIST