File: hintstest.cc

package info (click to toggle)
menu 2.1.5-3
  • links: PTS
  • area: main
  • in suites: potato
  • size: 1,476 kB
  • ctags: 1,251
  • sloc: cpp: 6,222; ansic: 2,306; sh: 453; makefile: 296; sed: 93
file content (40 lines) | stat: -rw-r--r-- 763 bytes parent folder | download | duplicates (4)
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
#include "hints.h"

void lees (vector <StrVec> &hint_input,
	   vector <int> &hint_count){
  StrVec h;
  char c;
  //  map <char, int, less<char> >::iterator hi;

  while (cin.get(c)){
    switch(c){
    case '\n':
      hint_input.push_back(h);
      hint_count.push_back(1);
      h.erase(h.begin(), h.end());

      break;
    default:
      h.push_back(c);
      break;
    }
  }
}

int main(){
  vector <StrVec> hint_input, hint_output;
  vector <hint_tree> children;
  vector <int> hint_count;
  hints h;

  hint_tree t('-',children);

  lees(hint_input, hint_count);
  h.set_nentry(3);
  h.set_topnentry(3);
  h.set_mixedpenalty(0);
  h.set_max_local_penalty(50);
  h.set_minhintfreq(0.0001);
  h.set_debug(true);
  h.calc_tree(hint_input, hint_output);
}