Skip to content

Commit

Permalink
prefer C++14
Browse files Browse the repository at this point in the history
  • Loading branch information
kosloot committed Apr 25, 2023
1 parent 7dedb3e commit be5f90b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 17 deletions.
2 changes: 1 addition & 1 deletion src/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
AM_CPPFLAGS = -I@top_srcdir@/include
AM_CXXFLAGS = -DSYSCONF_PATH=\"$(datadir)\" -std=c++11 -W -Wall -pedantic -g -O3
AM_CXXFLAGS = -DSYSCONF_PATH=\"$(datadir)\" -std=c++14 -W -Wall -pedantic -g -O3
bin_PROGRAMS = frog mbma mblem ner

frog_SOURCES = Frog.cxx
Expand Down
34 changes: 18 additions & 16 deletions src/mbma_mod.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -740,14 +740,14 @@ void Mbma::filterSubTags( const vector<UnicodeString>& feats ){
}
}
// now we can remove all analysis that aren't in the set.
auto it = analysis.begin();
while ( it != analysis.end() ){
if ( highConf.find( *it ) == highConf.end() ){
delete *it;
it = analysis.erase( it );
auto ana = analysis.begin();
while ( ana != analysis.end() ){
if ( highConf.find( *ana ) == highConf.end() ){
delete *ana;
ana = analysis.erase( ana );
}
else {
++it;
++ana;
}
}

Expand All @@ -771,10 +771,12 @@ void Mbma::filterSubTags( const vector<UnicodeString>& feats ){
// but only relevant for doDeep
tmp += ait->inflection;
}
if ( unique.find(tmp) == unique.end() ){
// make sure to preserve the first one
unique[tmp] = ait;
}
// if ( unique.find(tmp) == unique.end() ){
// // make sure to preserve the first one
// unique[tmp] = ait;
// }
// make sure to preserve the first one
unique.emplace(tmp,ait);
}
// so now we have map of 'equal' analysis.
// create a set for reverse lookup, using the Rule.ID to distinguish Rule's
Expand All @@ -783,14 +785,14 @@ void Mbma::filterSubTags( const vector<UnicodeString>& feats ){
uniqueAna.insert( uit.second );
}
// now we can remove all analysis that aren't in that set.
it = analysis.begin();
while ( it != analysis.end() ){
if ( uniqueAna.find( *it ) == uniqueAna.end() ){
delete *it;
it = analysis.erase( it );
ana = analysis.begin();
while ( ana != analysis.end() ){
if ( uniqueAna.find( *ana ) == uniqueAna.end() ){
delete *ana;
ana = analysis.erase( ana );
}
else {
++it;
++ana;
}
}
if ( debugFlag > 1){
Expand Down

0 comments on commit be5f90b

Please sign in to comment.