From af6c53c3f36456574b15315115418cb9fd4ab2ca Mon Sep 17 00:00:00 2001 From: Erik Auerswald Date: Sat, 18 May 2024 21:44:42 +0200 Subject: [PATCH] add lower case n for consistency with lower case c Neither lower case c nor lower case n can happen with correct image segmentation. Lower case c was already used in the code, but lower case n was only found as a comment. I am not sure if I want to keep this or rather remove both lower case variants. I do want to have this consistent, though. --- charset.c | 1 + defines.h | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/charset.c b/charset.c index ad9156b..ab9d506 100644 --- a/charset.c +++ b/charset.c @@ -89,6 +89,7 @@ void init_charset(charset_t cs) charset_array[D_R] = 'r'; charset_array[D_P] = 'p'; charset_array[D_N] = 'n'; + charset_array[D_n] = 'n'; charset_array[D_Y] = 'y'; charset_array[D_J] = 'j'; break; diff --git a/defines.h b/defines.h index 23118ca..edb89cf 100644 --- a/defines.h +++ b/defines.h @@ -76,6 +76,7 @@ #define D_HEX_A (ALL_SEGS & ~HORIZ_DOWN) #define D_HEX_b (ALL_SEGS & ~(HORIZ_UP | VERT_RIGHT_UP)) #define D_HEX_C (ALL_SEGS & ~(VERT_RIGHT_UP | HORIZ_MID | VERT_RIGHT_DOWN)) +/* a C in the lower half can only happen when digit boundary detection fails */ #define D_HEX_c (HORIZ_MID | VERT_LEFT_DOWN | HORIZ_DOWN) #define D_HEX_d (ALL_SEGS & ~(HORIZ_UP | VERT_LEFT_UP)) #define D_HEX_E (ALL_SEGS & ~(VERT_RIGHT_UP | VERT_RIGHT_DOWN)) @@ -87,7 +88,8 @@ #define D_R (D_ZERO & ~(VERT_RIGHT_DOWN | HORIZ_DOWN)) #define D_P (D_HEX_F | VERT_RIGHT_UP) #define D_N (D_ZERO & ~HORIZ_DOWN) -/* an N in the lower half can only happen when digit boundary detection fails *//* define D_LOW_N (VERT_LEFT_DOWN | VERT_RIGHT_DOWN | HORIZ_MID) */ +/* an N in the lower half can only happen when digit boundary detection fails */ +#define D_n (VERT_LEFT_DOWN | VERT_RIGHT_DOWN | HORIZ_MID) #define D_Y (ALL_SEGS & ~(HORIZ_UP | VERT_LEFT_DOWN)) #define D_J (HORIZ_DOWN | VERT_RIGHT_UP | VERT_RIGHT_DOWN) /* add two "wrong" 7 definitions used in a character set for a Chinese