Commit 7a044396 authored by David Geisler's avatar David Geisler

delete old main function

parent 7a501d38
#include <iostream>
#include <Document.h>
#include <NGram.h>
#include <Word.h>
int main() {
lsh::Word::Scanner wordScanner;
lsh::NGram<4>::Scanner ngram4Scanner;
lsh::NGram<5>::Scanner ngram5Scanner;
lsh::NGram<6>::Scanner ngram6Scanner;
std::vector<lsh::Document> doc;
doc.resize(7);
for(unsigned int i = 0; i < doc.size(); i++) {
doc[i].add(&wordScanner);
doc[i].add(&ngram4Scanner);
doc[i].add(&ngram5Scanner);
doc[i].add(&ngram6Scanner);
}
doc[0].add("My house is my castle!");
doc[1].add("My house is my castle and living space!");
doc[2].add("My castle is my house!");
doc[3].add("This sentence has nothing to do with the three above! But the castle appears!");
doc[4].add("Program is written in c++");
doc[5].add("My program is written in c++");
doc[6].add("I prefer to write my programs in c++");
printf(" |");
for(unsigned int j = 0; j < doc.size(); j++) {
printf(" Doc %02d |",j);
}
printf("\n");
for(unsigned int j = 0; j < doc.size()+1; j++) {
printf("--------+");
}
printf("\n");
for(unsigned int i = 0; i < doc.size(); i++) {
printf(" Doc %02d | ",i);
for(unsigned int j = 0; j < doc.size(); j++) {
printf("%0.4f | ",doc[i].similarity(doc[j],1000,i*doc.size()+j));
fflush(stdout);
}
printf("\n");
for(unsigned int j = 0; j < doc.size()+1; j++) {
printf("--------+");
}
printf("\n");
}
return 0;
}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment