-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
56 lines (46 loc) · 1.55 KB
/
main.cpp
File metadata and controls
56 lines (46 loc) · 1.55 KB
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
// Copyright 2012 Florian Petran
#include<string>
#include<utility>
#include<stdexcept>
#include<iostream>
#include"align.h"
int main(int argc, char* argv[]) {
std::pair<std::string, std::string> files;
try {
files = Align::Params::get().parse(argc, argv);
} catch(std::runtime_error e) {
std::cerr << e.what() << std::endl;
return 1;
}
try {
const std::string &e_name = files.first,
&f_name = files.second;
Align::DictionaryFactory* df =
&Align::DictionaryFactory::get_instance();
const Align::Dictionary* dict = df->get_dictionary(e_name, f_name);
Align::Candidates c(*dict);
c.collect();
Align::AlignMake align_make(&c);
align_make.initial_sequences()
.expand_sequences();
const Align::Dictionary* rdict = df->get_dictionary(f_name, e_name);
Align::Candidates rc(*rdict);
Align::AlignMake reverse_make(&rc);
reverse_make.initial_sequences()
.expand_sequences();
Align::Hypothesis *result = align_make.get_result(),
*rresult = reverse_make.get_result();
rresult->reverse();
result->munch(rresult);
align_make.merge_sequences()
.collect_scores()
.get_topranking();
for (Align::Sequence* seq : *result)
std::cout << *seq << std::endl;
}
catch(std::runtime_error e) {
std::cerr << e.what() << std::endl;
return 1;
}
return 0;
}