-
Notifications
You must be signed in to change notification settings - Fork 0
/
bagOfWord.cpp
63 lines (49 loc) · 1.37 KB
/
bagOfWord.cpp
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
56
57
58
59
60
61
62
63
#include <iostream>
#include <vector>
#include <string>
#include "WordVector.hpp"
int main(int count, char *args[]){
std::vector< std::string > paraFileName;
count--;
//passed fileName using Command line
if( count >= 1){
for( int i=1; i <= count; i++){
paraFileName.push_back(args[i]);
}
}
//If the command line parameter are not Valid
//Or not passed correctly
if( paraFileName.size() == 0 ) {
int num = 0;
std::string fileName;
std::cout << "Num the input Files " << std::endl;
std::cin >> num;
while( num-- ){
if( !(std::cin >> fileName) ){
std::cout << "File Does not Exist" << std::endl;
break;
}
paraFileName.push_back( fileName );
std::cout << fileName << std::endl;
}
}
//Context Creation
std::vector< class ContextWords * > test;
for( auto &elem : paraFileName ){
class ContextWords *temp = new ContextWords( elem );
test.push_back( temp );
}
/*
test0.printContextDetails(1);
std::cout << std::endl << std::endl << "The Informative words are ------------ " << std::endl;
test0.findInformativeWord();
test0.printInformativeContextDetails(1);
*/
int windowSize;
std::cout << std::endl << "Enter windows Size : - " << std::endl;
std::cin >> windowSize;
WordVector wordVec( test );
wordVec.inputFill( windowSize );
wordVec.computeSVD();
return 0;
}