diff --git a/langen.cpp b/langen.cpp index 26eee3bb..14757c96 100644 --- a/langen.cpp +++ b/langen.cpp @@ -35,7 +35,7 @@ template struct dictionary { else m[s] = std::move(val); } T& operator [] (const std::string& s) { return m[s]; } - int count(const std::string& s) { return m.count(s); } + int count(const std::string& s) const { return m.count(s); } }; dictionary d[NUMLAN]; @@ -248,8 +248,37 @@ void langPT() { int completeness[NUMLAN]; +template +void compute_completeness(const T& dict) +{ + std::set s; + for(int i=1; i s; - for(int i=1; i