⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 hyphen.cpp

📁 一OCR的相关资料。.希望对研究OCR的朋友有所帮助.
💻 CPP
字号:
/* -*-C-*- ******************************************************************************** * * File:        hyphen.c  (Formerly hyphen.c) * Description: * Author:       Mark Seaman, OCR Technology * Created:      Fri Oct 16 14:37:00 1987 * Modified:     Thu Mar 14 11:09:43 1991 (Mark Seaman) marks@hpgrlt * Language:     C * Package:      N/A * Status:       Reusable Software Component * * (c) Copyright 1987, 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. * *********************************************************************************//*----------------------------------------------------------------------              I n c l u d e s----------------------------------------------------------------------*/#include "const.h"#include "hyphen.h"#include "tordvars.h"#include "callcpp.h"#include <math.h>/*----------------------------------------------------------------------              V a r i a b l e s----------------------------------------------------------------------*/int last_word_on_line = 0;char *hyphen_string = 0;float hyphen_rating = MAXFLOAT;int hyphen_state = 0;/*----------------------------------------------------------------------              F u n c t i o n s---------------------------------------------------------------------*//********************************************************************** * set_hyphen_word * * If this hyphenated word choice is better than the last one then add * it as the new word choice.  This string can be used on the next * line to permute the other half of the word. **********************************************************************/void set_hyphen_word(char *word, float rating, int state) {   int char_index = strlen (word) - 1;  if (display_ratings)    cprintf ("set hyphen word = %s\n", word);  if (hyphen_rating > rating && char_index > 0) {    word[char_index] = '\0';    if (hyphen_string)      strfree(hyphen_string);     hyphen_string = strsave (word);    hyphen_state = state;    hyphen_rating = rating;    word[char_index] = '-';  }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -