~ubuntu-branches/ubuntu/precise/cuneiform/precise

« back to all changes in this revision

Viewing changes to cuneiform_src/Kern/pass2/src/p2_rstr.c

  • Committer: Bazaar Package Importer
  • Author(s): Jakub Wilk, c-assert.diff, slovenian-slv.diff
  • Date: 2011-01-26 21:53:07 UTC
  • mfrom: (5.1.1 experimental)
  • Revision ID: james.westby@ubuntu.com-20110126215307-62x61mcesr607qb7
Tags: 1.0.0+dfsg-2
* Upload to unstable.
* Explicitly build-depend on pkg-config. Thanks to Stefano Rivera for the
  bug report.
* Add Vcs-* fields.
* Use the standard C assert() macro, rather than custom Cuneiform one.
  [c-assert.diff]
* Pass CFLAGS, CXXFLAGS and LDFLAGS (get from dpkg-buildflags) to cmake
  (closes: #608345). Thanks to Sami Liedes for the bug report.
  + Build depend on dpkg-dev (>= 1.15.7).
* Pass --parallel to dh.
  + Bump debhelper minimum version to 7.4.10.
* Update debian/copyright to the latest DEP-5 version.
* Bump year in debian/copyright.
* Explicitly link to GraphicsMagick (rather than via the ImageMagick
  compatibility layer).
* Don't ship /usr/lib/cuneiform/*.so symlinks. These libraries are
  considered private, at least until #598616 is fixed.
* Rename some private variables in debian/rules to make them lowercase.
* Update patch headers.
* Provide proper ‘build-arch’ and ‘build-indep’ targets in debian/rules.
* Document input format in the manual page (closes: #572061). Thanks to
  Janusz S. Bień for the bug report.
* Use ‘slv’ (rather than ‘slo’) as language code for Slovenian.
  [slovenian-slv.diff]
* Fix package description: Slovenian is supported, Slovak is not.
* Improve documentation of the language (-l) option (closes: #602512).
  Thanks to Jari Aalto for the bug report.
* Install reasons file for vrms.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
Copyright (c) 1993-2008, Cognitive Technologies
3
3
All rights reserved.
4
4
 
5
 
����������� ��������� ��������������� � ������������� ��� � ���� ��������� ����,
6
 
��� � � �������� �����, � ����������� ��� ���, ��� ���������� ��������� �������:
7
 
 
8
 
      * ��� ��������� ��������������� ��������� ���� ������ ���������� ���������
9
 
        ���� ����������� �� ��������� �����, ���� ������ ������� � �����������
10
 
        ����� �� ��������.
11
 
      * ��� ��������� ��������������� ��������� ���� � ������������ �/��� �
12
 
        ������ ����������, ������������ ��� ���������������, ������ �����������
13
 
        ��������� ���� ���������� �� ��������� �����, ���� ������ ������� �
14
 
        ����������� ����� �� ��������.
15
 
      * �� �������� Cognitive Technologies, �� ����� �� ����������� �� �����
16
 
        ���� ������������ � �������� �������� ��������� �/��� �����������
17
 
        ���������, ���������� �� ���� ��, ��� ���������������� �����������
18
 
        ����������.
19
 
 
20
 
��� ��������� ������������� ����������� ��������� ���� �/��� ������� ������ "���
21
 
��� ����" ��� ������-���� ���� ��������, ���������� ���� ��� ���������������,
22
 
������� �������� ������������ �������� � ����������� ��� ���������� ����, �� ��
23
 
������������� ���. �� �������� ��������� ���� � �� ���� ������ ����, �������
24
 
����� �������� �/��� �������� �������������� ���������, �� � ���� ������ ��
25
 
��Ѩ� ���������������, ������� ����� �����, ���������, ����������� ���
26
 
������������� ������, ��������� � �������������� ��� ���������� ����������
27
 
������������� ������������� ��������� (������� ������ ������, ��� ������,
28
 
������� ���������, ��� ������ �/��� ������ �������, ���������� ��-�� ��������
29
 
������� ��� �/��� ������ ��������� �������� ��������� � ������� �����������,
30
 
�� �� ������������� ����� ��������), �� �� ������������� ���, ���� ���� �����
31
 
�������� ��� ������ ���� ���� �������� � ����������� ����� ������� � ������.
 
5
Разрешается повторное распространение и использование как в виде исходного кода,
 
6
так и в двоичной форме, с изменениями или без, при соблюдении следующих условий:
 
7
 
 
8
      * При повторном распространении исходного кода должны оставаться указанное
 
9
        выше уведомление об авторском праве, этот список условий и последующий
 
10
        отказ от гарантий.
 
11
      * При повторном распространении двоичного кода в документации и/или в
 
12
        других материалах, поставляемых при распространении, должны сохраняться
 
13
        указанная выше информация об авторском праве, этот список условий и
 
14
        последующий отказ от гарантий.
 
15
      * Ни название Cognitive Technologies, ни имена ее сотрудников не могут
 
16
        быть использованы в качестве средства поддержки и/или продвижения
 
17
        продуктов, основанных на этом ПО, без предварительного письменного
 
18
        разрешения.
 
19
 
 
20
ЭТА ПРОГРАММА ПРЕДОСТАВЛЕНА ВЛАДЕЛЬЦАМИ АВТОРСКИХ ПРАВ И/ИЛИ ДРУГИМИ ЛИЦАМИ "КАК
 
21
ОНА ЕСТЬ" БЕЗ КАКОГО-ЛИБО ВИДА ГАРАНТИЙ, ВЫРАЖЕННЫХ ЯВНО ИЛИ ПОДРАЗУМЕВАЕМЫХ,
 
22
ВКЛЮЧАЯ ГАРАНТИИ КОММЕРЧЕСКОЙ ЦЕННОСТИ И ПРИГОДНОСТИ ДЛЯ КОНКРЕТНОЙ ЦЕЛИ, НО НЕ
 
23
ОГРАНИЧИВАЯСЬ ИМИ. НИ ВЛАДЕЛЕЦ АВТОРСКИХ ПРАВ И НИ ОДНО ДРУГОЕ ЛИЦО, КОТОРОЕ
 
24
МОЖЕТ ИЗМЕНЯТЬ И/ИЛИ ПОВТОРНО РАСПРОСТРАНЯТЬ ПРОГРАММУ, НИ В КОЕМ СЛУЧАЕ НЕ
 
25
НЕСЁТ ОТВЕТСТВЕННОСТИ, ВКЛЮЧАЯ ЛЮБЫЕ ОБЩИЕ, СЛУЧАЙНЫЕ, СПЕЦИАЛЬНЫЕ ИЛИ
 
26
ПОСЛЕДОВАВШИЕ УБЫТКИ, СВЯЗАННЫЕ С ИСПОЛЬЗОВАНИЕМ ИЛИ ПОНЕСЕННЫЕ ВСЛЕДСТВИЕ
 
27
НЕВОЗМОЖНОСТИ ИСПОЛЬЗОВАНИЯ ПРОГРАММЫ (ВКЛЮЧАЯ ПОТЕРИ ДАННЫХ, ИЛИ ДАННЫЕ,
 
28
СТАВШИЕ НЕГОДНЫМИ, ИЛИ УБЫТКИ И/ИЛИ ПОТЕРИ ДОХОДОВ, ПОНЕСЕННЫЕ ИЗ-ЗА ДЕЙСТВИЙ
 
29
ТРЕТЬИХ ЛИЦ И/ИЛИ ОТКАЗА ПРОГРАММЫ РАБОТАТЬ СОВМЕСТНО С ДРУГИМИ ПРОГРАММАМИ,
 
30
НО НЕ ОГРАНИЧИВАЯСЬ ЭТИМИ СЛУЧАЯМИ), НО НЕ ОГРАНИЧИВАЯСЬ ИМИ, ДАЖЕ ЕСЛИ ТАКОЙ
 
31
ВЛАДЕЛЕЦ ИЛИ ДРУГОЕ ЛИЦО БЫЛИ ИЗВЕЩЕНЫ О ВОЗМОЖНОСТИ ТАКИХ УБЫТКОВ И ПОТЕРЬ.
32
32
 
33
33
Redistribution and use in source and binary forms, with or without modification,
34
34
are permitted provided that the following conditions are met:
55
55
*/
56
56
 
57
57
 #include <stdlib.h>
58
 
 
59
 
 #include "nt_types.h"
60
58
 #include <stdio.h>
61
59
 #include <string.h>
62
60
 
63
61
 #include "cstr.h"
64
62
 #include "p2.h"
65
63
 
66
 
// ���������� � �����������/�������� ����� - �� first �� last,
67
 
// ��������� ��������� � lineFon
68
 
Int32 my_p2_RecogCutGlu( CSTR_rast  first,CSTR_rast last, CSTR_line  lineFon,
 
64
// распознать с разрезанием/склейкой кусок - от first до last,
 
65
// результат поместить в lineFon
 
66
int32_t my_p2_RecogCutGlu( CSTR_rast  first,CSTR_rast last, CSTR_line  lineFon,
69
67
                                                P2GLOBALS *p2glob)
70
68
                   {return 0;};
71
69
 
72
70
//////////////////////
73
 
// ���������� �������, �������������
 
71
// допустимые символы, перекодировка
74
72
void  my_p2_SetP2Alphabet(int lang,char *alf)
75
73
{
76
74
          memset(alf,0,256);
77
75
          return;
78
76
}
79
 
BYTE  my_p2_GetCodePage(int lang){return 0;};
 
77
uchar  my_p2_GetCodePage(int lang){return 0;};
80
78
void  my_p2_DecodeCode(char *pCode,int let){return;};
81
79
//////////////////
82
 
// ����
83
 
BOOL    my_NoStopSnapLEO(void){return FALSE;};
84
 
Bool16  my_snap_monitor_ori(CSTR_line *snap_line, Int32 num_lines){return FALSE;};
85
 
Bool16  my_snap_activity(Word8 a){return FALSE;};
86
 
Bool16  my_snap_show_text(Word8 *txt){return FALSE;};
 
80
// снэр
 
81
Bool    my_NoStopSnapLEO(void){return FALSE;};
 
82
Bool16  my_snap_monitor_ori(CSTR_line *snap_line, int32_t num_lines){return FALSE;};
 
83
Bool16  my_snap_activity(uchar a){return FALSE;};
 
84
Bool16  my_snap_show_text(uchar *txt){return FALSE;};
87
85
 
88
 
Bool32  mySetupField(void *letInfo,Int32 nFont,void *info) {return FALSE;};
 
86
Bool32  mySetupField(void *letInfo,int32_t nFont,void *info) {return FALSE;};
89
87
Bool32  mySetupPage(void *info) {return FALSE;};
90
88
Bool32  mySpecRecog(RecObject *ro) {return FALSE;};
91
89
///////////////
92
 
// �������� �� �������
93
 
BOOL    my_p2_spell(PCHAR s,BYTE lang) {return FALSE;};
 
90
// проверка по словарю
 
91
Bool    my_p2_spell(pchar s,uchar lang) {return FALSE;};
94
92
 
95
93
///////////////////////////////
96
 
// ���������� � �����������/�������� ����� - �� first �� last,
97
 
// ��������� ��������� � lineFon
98
 
Int32 (*RSTR_p2_RecogCutGlu)( CSTR_rast  first,CSTR_rast last, CSTR_line  lineFon,
 
94
// распознать с разрезанием/склейкой кусок - от first до last,
 
95
// результат поместить в lineFon
 
96
int32_t (*RSTR_p2_RecogCutGlu)( CSTR_rast  first,CSTR_rast last, CSTR_line  lineFon,
99
97
                                                         P2GLOBALS *pglob)=
100
98
                   my_p2_RecogCutGlu;
101
99
 
102
100
//////////////////////
103
 
// ���������� �������, �������������
 
101
// допустимые символы, перекодировка
104
102
void  (*RSTR_p2_SetP2Alphabet)(int lang,char *alf)=my_p2_SetP2Alphabet;
105
 
BYTE  (*RSTR_p2_GetCodePage)(int lang)=my_p2_GetCodePage;
 
103
uchar  (*RSTR_p2_GetCodePage)(int lang)=my_p2_GetCodePage;
106
104
void  (*RSTR_p2_DecodeCode)(char *pCode,int let)=my_p2_DecodeCode;
107
105
//////////////////
108
 
// ����
109
 
BOOL    (*RSTR_p2_NoStopSnapLEO)(void)=my_NoStopSnapLEO;
110
 
Bool16  (*RSTR_p2_snap_monitor_ori)(CSTR_line *snap_line, Int32 num_lines)=my_snap_monitor_ori;
111
 
Bool16  (*RSTR_p2_snap_activity)(Word8 a)=my_snap_activity;
112
 
Bool16  (*RSTR_p2_snap_show_text)(Word8 *txt)=my_snap_show_text;
 
106
// снэр
 
107
Bool    (*RSTR_p2_NoStopSnapLEO)(void)=my_NoStopSnapLEO;
 
108
Bool16  (*RSTR_p2_snap_monitor_ori)(CSTR_line *snap_line, int32_t num_lines)=my_snap_monitor_ori;
 
109
Bool16  (*RSTR_p2_snap_activity)(uchar a)=my_snap_activity;
 
110
Bool16  (*RSTR_p2_snap_show_text)(uchar *txt)=my_snap_show_text;
113
111
///////////////
114
 
// �������� �� �������
115
 
BOOL    (*RSTR_p2_spell)(PCHAR s,BYTE lang)=my_p2_spell;
 
112
// проверка по словарю
 
113
Bool    (*RSTR_p2_spell)(pchar s,uchar lang)=my_p2_spell;
116
114
 
117
 
// �������������� ������������� (LEO)
118
 
Bool32  (*ADDREC_SetupField)(void *letInfo,Int32 nFont,void* fontInfo)=mySetupField;
 
115
// дополнительное распознавание (LEO)
 
116
Bool32  (*ADDREC_SetupField)(void *letInfo,int32_t nFont,void* fontInfo)=mySetupField;
119
117
Bool32  (*ADDREC_SetupPage)(void *info)=mySetupPage;
120
118
Bool32  (*ADDREC_Recog)(RecObject* obj)=mySpecRecog;
121
119
 
122
 
//Word8 db_status=0;
123
 
//Word8   spec_camera=0;
 
120
//uchar db_status=0;
 
121
//uchar   spec_camera=0;
124
122
 
125
123
P2_FUNC(void) P2_SetRSTR( Handle RecogCutGlu,
126
124
                          Handle setAlpha,Handle GetPage,Handle Decode,