-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscan_langid.C
82 lines (71 loc) · 2.78 KB
/
scan_langid.C
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
/************************************************************************/
/* */
/* LA-Strings: language-aware text-strings extraction */
/* by Ralf Brown / Carnegie Mellon University */
/* */
/* File: scan_langid.C */
/* Version: 1.00 */
/* LastEdit: 26aug2011 */
/* */
/* (c) Copyright 2011 Ralf Brown/CMU */
/* This program is free software; you can redistribute it and/or */
/* modify it under the terms of the GNU General Public License as */
/* published by the Free Software Foundation, version 3. */
/* */
/* This program is distributed in the hope that it will be */
/* useful, but WITHOUT ANY WARRANTY; without even the implied */
/* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR */
/* PURPOSE. See the GNU General Public License for more details. */
/* */
/* You should have received a copy of the GNU General Public */
/* License (file COPYING) along with this program. If not, see */
/* http://www.gnu.org/licenses/ */
/* */
/************************************************************************/
#ifdef BULK_EXTRACTOR
#include <cstdlib>
#include <cstdio>
#include "bulk_extractor.h"
#include "langid.h"
#include "FramepaC.h"
/************************************************************************/
/************************************************************************/
static unsigned sequence_number = 0 ;
static char *output_dir = "extract%" ;
/************************************************************************/
/************************************************************************/
static void process_buffer(const sbuf_t scanbuf, const char *output_directory)
{
const uint8_t *buffer_start = scanbuf.buf ;
const uint8_t *buffer_end = scanbuf.buf + scanbuf.size() ;
#if 0
if (!process_file_data(buffer_start,buffer_end,"-",output_directory,false,
sequence_number,true))
#endif
{
}
return ;
}
//----------------------------------------------------------------------
extern "C" void scan_langid(const class scanner_params &sp,
const class recursion_control_block &rcb)
{
switch (sp.phase)
{
case 0: // startup
//FIXME
break ;
case 1: // normal scan
process_buffer(sp.sbuf,output_dir) ;
break ;
case 2: // shutdown
//FIXME
break ;
default:
fprintf(stderr,"Invalid 'phase' parameter to scan_ziprec\n") ;
break ;
}
return ;
}
#endif /* BULK_EXTRACTOR */
// end of file scan_strings.C //