source: gs2-extensions/ngramj/src/wiki/wiki2xml/main.cpp@ 25141

Last change on this file since 25141 was 25141, checked in by papitha, 12 years ago

NGRAMJ PERL MODULE ADDED /MAORI LANGUAGE GUESSING WORKING WELL!!

File size: 868 bytes
Line 
1#include "WIKI2XML.h"
2
3#include <stdio.h>
4#include <time.h>
5
6void read_from_file ( istream &infile , vector <string> &lines )
7 {
8 int a ;
9 string line ;
10 lines.clear () ;
11 while (getline(infile,line,'\n'))
12 {
13 lines.push_back (line);
14 }
15 }
16
17int main(int argc, char *argv[])
18 {
19 ifstream infile ( "test.txt" , ios::in ) ;
20 vector <string> lines ;
21 read_from_file ( infile , lines ) ;
22
23 int c1 = clock () ;
24
25// for ( int a = 0 ; a < 2200 ; a++ )
26// {
27 WIKI2XML w2x ( lines ) ;
28 w2x.parse () ;
29// }
30
31 int c2 = clock () ;
32
33 cout << ( c2 - c1 ) << " clock" << endl ;
34 cout << (float) ( c2 - c1 ) / CLK_TCK << " seconds" << endl ;
35
36 ofstream out ( "test.xml" , ios::out ) ;
37 cout << w2x.get_xml () << endl ;
38
39 system("PAUSE");
40 return 0;
41 }
Note: See TracBrowser for help on using the repository browser.