1 /******************************************************************************
2 ** Filename: extract.c
3 ** Purpose: Generic high level feature extractor routines.
4 ** Author: Dan Johnson
5 ** History: Sun Jan 21 09:44:08 1990, 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 /**----------------------------------------------------------------------------
19 Include Files and Type Defines
20 ----------------------------------------------------------------------------**/
21 #include "extract.h"
22 #include "flexfx.h"
23 #include "funcdefs.h"
24 #include "danerror.h"
25
26 typedef CHAR_FEATURES (*CF_FUNC) ();
27
28 /**----------------------------------------------------------------------------
29 Private Function Prototypes
30 ----------------------------------------------------------------------------**/
31 void ExtractorStub();
32
33 /**----------------------------------------------------------------------------
34 Global Data Definitions and Declarations
35 ----------------------------------------------------------------------------**/
36 /* tables to keep track of the different low level feature extractors */
37 #define NUM_FX 3
38 #define DEFAULT_FX 2
39
40 int CurrentFx = DEFAULT_FX;
41
42 /**----------------------------------------------------------------------------
43 Public Code
44 ----------------------------------------------------------------------------**/
45 /*---------------------------------------------------------------------------*/
ExtractBlobFeatures(TBLOB * Blob,LINE_STATS * LineStats)46 CHAR_DESC ExtractBlobFeatures(TBLOB *Blob, LINE_STATS *LineStats) {
47 /*
48 ** Parameters:
49 ** Blob blob to extract features from
50 ** LineStats statistics about line blob is in
51 ** Operation: Extract features from Blob by calling the feature
52 ** extractor which is currently being used. This routine
53 ** simply provides a high level interface to feature
54 ** extraction. The caller can extract any type of features
55 ** from a blob without understanding any lower level details.
56 ** Return: The character features extracted from Blob.
57 ** Exceptions: none
58 ** History: Sun Jan 21 10:07:28 1990, DSJ, Created.
59 */
60 return (ExtractFlexFeatures (Blob, LineStats));
61 } /* ExtractBlobFeatures */
62
63 /**----------------------------------------------------------------------------
64 Private Code
65 ----------------------------------------------------------------------------**/
66 /*---------------------------------------------------------------------------*/
67 void
ExtractorStub()68 ExtractorStub ()
69 /*
70 ** Parameters: none
71 ** Globals: none
72 ** Operation: This routine is used to stub out feature extractors
73 ** that are no longer used. It simply calls DoError.
74 ** Return: none
75 ** Exceptions: none
76 ** History: Wed Jan 2 14:16:49 1991, DSJ, Created.
77 */
78 #define DUMMY_ERROR 1
79 {
80 DoError (DUMMY_ERROR, "Selected feature extractor has been stubbed out!");
81 } /* ExtractorStub */
82