1 /****************************************************************************** 2 ** Filename: stopper.h 3 ** Purpose: Stopping criteria for word classifier. 4 ** Author: Dan Johnson 5 ** History: Wed May 1 09:42:57 1991, DSJ, Created. 6 ** 7 ** (c) Copyright Hewlett-Packard Company, 1988. 8 ** Licensed under the Apache License, Version 2.0 (the "License"); 9 ** you may not use this file except in compliance with the License. 10 ** You may obtain a copy of the License at 11 ** http://www.apache.org/licenses/LICENSE-2.0 12 ** Unless required by applicable law or agreed to in writing, software 13 ** distributed under the License is distributed on an "AS IS" BASIS, 14 ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 ** See the License for the specific language governing permissions and 16 ** limitations under the License. 17 ******************************************************************************/ 18 #ifndef STOPPER_H 19 #define STOPPER_H 20 21 /**---------------------------------------------------------------------------- 22 Include Files and Type Defines 23 ----------------------------------------------------------------------------**/ 24 25 #include "states.h" 26 #include "unichar.h" 27 #include "varable.h" 28 29 typedef uinT8 BLOB_WIDTH; 30 31 typedef struct 32 { 33 inT16 index; 34 unsigned bad_length:8; 35 unsigned good_length:8; 36 } DANGERR; 37 38 enum ACCEPTABLE_CHOICE_CALLER { CHOPPER_CALLER, ASSOCIATOR_CALLER }; 39 typedef struct 40 { 41 UNICHAR_ID Class; 42 uinT16 NumChunks; 43 float Certainty; 44 } 45 46 47 CHAR_CHOICE; 48 49 typedef struct 50 { 51 float Rating; 52 float Certainty; 53 FLOAT32 AdjustFactor; 54 int Length; 55 bool ComposedFromCharFragments; 56 CHAR_CHOICE Blob[1]; 57 } VIABLE_CHOICE_STRUCT; 58 typedef VIABLE_CHOICE_STRUCT *VIABLE_CHOICE; 59 60 /*--------------------------------------------------------------------------- 61 Variables 62 ---------------------------------------------------------------------------*/ 63 extern double_VAR_H(stopper_certainty_per_char, -0.50, 64 "Certainty to add for each dict char above small word size."); 65 66 extern double_VAR_H(stopper_nondict_certainty_base, -2.50, 67 "Certainty threshold for non-dict words"); 68 69 extern double_VAR_H(stopper_phase2_certainty_rejection_offset, 1.0, 70 "Reject certainty offset"); 71 72 extern INT_VAR_H(stopper_debug_level, 0, "Stopper debug level"); 73 74 extern BOOL_VAR_H(stopper_no_acceptable_choices, false, 75 "Make AcceptableChoice() always return false. Useful" 76 " when there is a need to explore all segmentations"); 77 78 extern BOOL_VAR_H(save_raw_choices, false, "Save all explored raw choices"); 79 80 #endif 81