| 1 |
#include "Words.h" |
| 2 |
#include "Ratios.h" |
| 3 |
#include "Meanings.h" |
| 4 |
#include "FastSaurus.h" |
| 5 |
#include <iostream> |
| 6 |
#include <fstream> |
| 7 |
#include <algorithm> |
| 8 |
using namespace std; |
| 9 |
|
| 10 |
int main() |
| 11 |
{ |
| 12 |
cout << "Enter meanings file name: " << flush; |
| 13 |
string meaningsfile; cin >> meaningsfile; |
| 14 |
|
| 15 |
cout << "Enter output file name: " << flush; |
| 16 |
string outputfile; cin >> outputfile; |
| 17 |
|
| 18 |
|
| 19 |
cout << "Reading in meanings file... " << flush; |
| 20 |
vector<MeaningSet> meanings; |
| 21 |
ifstream min(meaningsfile.c_str()); |
| 22 |
extractMeaningFamily(min, meanings); |
| 23 |
cout << meanings.size() << " meaning classes read." << endl; |
| 24 |
|
| 25 |
|
| 26 |
ofstream out(outputfile.c_str()); |
| 27 |
|
| 28 |
for(vector<MeaningSet>::iterator x = meanings.begin();x != meanings.end();++x) |
| 29 |
{ |
| 30 |
MeaningSet& ms = *x; |
| 31 |
|
| 32 |
for(unsigned int i = 0;i < ms.size();++i) |
| 33 |
{ |
| 34 |
double rlr = returnLinkRatio(ms[i], ms); |
| 35 |
double dlr = directLinkRatio(ms[i], ms); |
| 36 |
|
| 37 |
if (rlr + dlr >= .2) |
| 38 |
out << ms[i] << ' '; |
| 39 |
} |
| 40 |
|
| 41 |
out << '\n'; |
| 42 |
} |
| 43 |
|
| 44 |
return 0; |
| 45 |
} |