mirror of
https://github.com/tesseract-ocr/tesseract.git
synced 2024-12-25 00:07:49 +08:00
2a678305c6
git-svn-id: https://tesseract-ocr.googlecode.com/svn/trunk@133 d0cd1f9f-072b-0410-8dd7-cf729c803f20
83 lines
2.4 KiB
C
83 lines
2.4 KiB
C
/* -*-C-*-
|
|
********************************************************************************
|
|
*
|
|
* File: context.h (Formerly context.h)
|
|
* Description: Context checking functions
|
|
* Author: Mark Seaman, OCR Technology
|
|
* Created: Thu Feb 15 11:18:24 1990
|
|
* Modified: Tue Jul 9 17:00:38 1991 (Mark Seaman) marks@hpgrlt
|
|
* Language: C
|
|
* Package: N/A
|
|
* Status: Experimental (Do Not Distribute)
|
|
*
|
|
* (c) Copyright 1990, Hewlett-Packard Company.
|
|
** Licensed under the Apache License, Version 2.0 (the "License");
|
|
** you may not use this file except in compliance with the License.
|
|
** You may obtain a copy of the License at
|
|
** http://www.apache.org/licenses/LICENSE-2.0
|
|
** Unless required by applicable law or agreed to in writing, software
|
|
** distributed under the License is distributed on an "AS IS" BASIS,
|
|
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
** See the License for the specific language governing permissions and
|
|
** limitations under the License.
|
|
*
|
|
********************************************************************************
|
|
*/
|
|
|
|
#ifndef CONTEXT_H
|
|
#define CONTEXT_H
|
|
|
|
#include "choices.h"
|
|
|
|
/*----------------------------------------------------------------------
|
|
F u n c t i o n s
|
|
----------------------------------------------------------------------*/
|
|
void close_choices();
|
|
|
|
void fix_quotes(char *str);
|
|
|
|
int punctuation_ok(const char *word, const char *lengths);
|
|
|
|
int case_ok(const char *word, const char *lengths);
|
|
|
|
void write_choice_line();
|
|
|
|
typedef double (*PROBABILITY_IN_CONTEXT_FUNCTION)(const char* context,
|
|
int context_bytes,
|
|
const char* character,
|
|
int character_bytes);
|
|
|
|
extern PROBABILITY_IN_CONTEXT_FUNCTION probability_in_context;
|
|
|
|
extern double def_probability_in_context(const char* context,
|
|
int context_bytes,
|
|
const char* character,
|
|
int character_bytes);
|
|
|
|
/*
|
|
#if defined(__STDC__) || defined(__cplusplus)
|
|
# define _ARGS(s) s
|
|
#else
|
|
# define _ARGS(s) ()
|
|
#endif*/
|
|
|
|
/* context.c
|
|
void close_choices
|
|
_ARGS((void));
|
|
|
|
void fix_quotes
|
|
_ARGS((char *str));
|
|
|
|
int punctuation_ok
|
|
_ARGS((char *word));
|
|
|
|
int case_ok
|
|
_ARGS((char *word));
|
|
|
|
void write_choice_line
|
|
_ARGS((void));
|
|
|
|
#undef _ARGS
|
|
*/
|
|
#endif
|