File: normalize.cc

package info (click to toggle)
tagcoll 1.6.3-2
  • links: PTS
  • area: main
  • in suites: etch
  • size: 2,500 kB
  • ctags: 2,062
  • sloc: cpp: 10,930; sh: 8,892; makefile: 201; lex: 54; yacc: 27
file content (39 lines) | stat: -rw-r--r-- 919 bytes parent folder | download | duplicates (2)
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
#include <tagcoll/experiments.h>
#include <tagcoll/Serializer.h>
#include <tagcoll/TextFormat.h>
#include <tagcoll/StdioParserInput.h>

#include <stdarg.h>

using namespace std;
using namespace Tagcoll;

int main (int argc, char *argv[])
{
	try {
		// Install the handler for unexpected exceptions
		InstallUnexpected installUnexpected;
		TrivialConverter<string, string> conv;
		Normalizer<string, string> norm(1.0);
		StdioParserInput in(stdin, "(stdin)");

		Scores<string> scores(0.7);
		scores.add("culture::* || use::*", 1.1);
		scores.add("implemented-in::*", 0.3);
		scores.add("*::TODO", 0.1);

		TextFormat<string, string>::parse(conv, conv, in, norm);

		norm.buildGraph(scores);
		norm.normalize();

		TextFormat<string, string> writer(conv, conv, stdout);
		norm.output(writer);

		return 0;
	} catch (Exception& e) {
		fprintf(stderr, "%s: %.*s\n", e.type(), PFSTR(e.desc()));
	}
}

// vim:set ts=4 sw=4: