forked from mia/Aegisub
391219ea54
1. svn mv assdraw csri hunspell lua51 contrib * See r2749 for full description. Originally committed to SVN as r2754.
52 lines
1.1 KiB
C++
52 lines
1.1 KiB
C++
#include <cstring>
|
|
#include <cstdlib>
|
|
#include <cstdio>
|
|
|
|
#include "textparser.hxx"
|
|
#include "htmlparser.hxx"
|
|
#include "latexparser.hxx"
|
|
|
|
#ifndef W32
|
|
using namespace std;
|
|
#endif
|
|
|
|
int
|
|
main(int argc, char** argv)
|
|
{
|
|
FILE * f;
|
|
/* first parse the command line options */
|
|
|
|
if (! argv[1]) {
|
|
fprintf(stderr,"correct syntax is:\n");
|
|
fprintf(stderr,"testparser file\n");
|
|
fprintf(stderr,"example: testparser /dev/stdin\n");
|
|
exit(1);
|
|
}
|
|
|
|
/* open the words to check list */
|
|
f = fopen(argv[1],"r");
|
|
if (!f) {
|
|
fprintf(stderr,"Error - could not open file of words to check\n");
|
|
exit(1);
|
|
}
|
|
|
|
TextParser * p = new LaTeXParser("qwertzuiopasdfghjklyxcvbnméáúõûóüöíQWERTZUIOPASDFGHJKLYXCVBNMÍÉÁÕÚÖÜÓÛ");
|
|
|
|
char buf[MAXLNLEN];
|
|
char * next;
|
|
|
|
while(fgets(buf,MAXLNLEN,f)) {
|
|
fprintf(stdout,"---------------------------------------\n");
|
|
p->put_line(buf);
|
|
fprintf(stderr, "x:%s\n", buf);
|
|
p->set_url_checking(1);
|
|
while ((next=p->next_token())) {
|
|
fprintf(stdout,"token: %s\n",next);
|
|
free(next);
|
|
}
|
|
}
|
|
|
|
delete p;
|
|
return 0;
|
|
}
|
|
|