Skip to content

Commit 32610f9

Browse files
committed
Squashed commit of the following:
modernizing, updated to latest ticcutils
1 parent 2d5c9e8 commit 32610f9

File tree

7 files changed

+32
-27
lines changed

7 files changed

+32
-27
lines changed

.github/workflows/mbt.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ on:
55
schedule:
66
- cron: "0 19 3 * 5" # run test once a month
77
push:
8-
branches: [master]
8+
branches:
9+
- master
10+
- develop
911
paths:
1012
- configure.ac
1113
- 'src/**'
@@ -45,10 +47,12 @@ jobs:
4547

4648
- uses: LanguageMachines/ticcactions/cpp-submodule-build@v1
4749
with:
50+
branch: ${{ github.ref_name }}
4851
module: ticcutils
4952

5053
- uses: LanguageMachines/ticcactions/cpp-submodule-build@v1
5154
with:
55+
branch: ${{ github.ref_name }}
5256
module: timbl
5357

5458
- uses: LanguageMachines/ticcactions/setup-cppcheck@v1

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ PKG_CHECK_MODULES([timbl], [timbl >= 6.8] )
6060
CXXFLAGS="$CXXFLAGS $timbl_CFLAGS"
6161
LIBS="$LIBS $timbl_LIBS"
6262

63-
PKG_CHECK_MODULES([ticcutils], [ticcutils >= 0.34] )
63+
PKG_CHECK_MODULES([ticcutils], [ticcutils >= 0.36] )
6464
CXXFLAGS="$CXXFLAGS $ticcutils_CFLAGS"
6565
LIBS="$LIBS $ticcutils_LIBS"
6666

src/GenerateTagger.cxx

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@ namespace Tagger {
8080

8181
template <typename T1, typename T2>
8282
struct more_second {
83-
using type = pair<T1, T2>;
84-
bool operator ()(type const& a, type const& b) const {
83+
using c_type = pair<T1, T2>;
84+
bool operator ()(c_type const& a, c_type const& b) const {
8585
return a.second > b.second;
8686
}
8787
};
@@ -531,24 +531,24 @@ namespace Tagger {
531531
}
532532
if ( opts.extract( 'D', value ) ){
533533
if ( value == "LogSilent" ){
534-
cur_log->setlevel( LogSilent );
535-
default_cout.setlevel( LogSilent );
534+
cur_log->set_level( LogSilent );
535+
default_cout.set_level( LogSilent );
536536
}
537537
else if ( value == "LogNormal" ){
538-
cur_log->setlevel( LogNormal );
539-
default_cout.setlevel( LogNormal );
538+
cur_log->set_level( LogNormal );
539+
default_cout.set_level( LogNormal );
540540
}
541541
else if ( value == "LogDebug" ){
542-
cur_log->setlevel( LogDebug );
543-
default_cout.setlevel( LogDebug );
542+
cur_log->set_level( LogDebug );
543+
default_cout.set_level( LogDebug );
544544
}
545545
else if ( value == "LogHeavy" ){
546-
cur_log->setlevel( LogHeavy );
547-
default_cout.setlevel( LogHeavy );
546+
cur_log->set_level( LogHeavy );
547+
default_cout.set_level( LogHeavy );
548548
}
549549
else if ( value == "LogExtreme" ){
550-
cur_log->setlevel( LogExtreme );
551-
default_cout.setlevel( LogExtreme );
550+
cur_log->set_level( LogExtreme );
551+
default_cout.set_level( LogExtreme );
552552
}
553553
else {
554554
cerr << "Unknown Debug mode! (-D " << value << ")" << endl;

src/MbtAPI.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ bool MbtAPI::GenerateTagger(int argc, char *argv[]) {
139139
// generate a tagger using argv.
140140
// Independent, static function so, don't use the internal _tagger here
141141
//
142-
cur_log->setlevel( Tagger_Log_Level );
142+
cur_log->set_level( Tagger_Log_Level );
143143
time_t timebefore, timeafter, timediff;
144144
time(&timebefore);
145145
int nw = TaggerClass::CreateTagger( argc, argv );
@@ -164,7 +164,7 @@ bool MbtAPI::GenerateTagger( const std::string& arg ) {
164164
// generate a tagger using a string.
165165
// Independent, static function so, don't use the internal _tagger here
166166
//
167-
cur_log->setlevel( Tagger_Log_Level );
167+
cur_log->set_level( Tagger_Log_Level );
168168
time_t timebefore, timeafter, timediff;
169169
time(&timebefore);
170170
int nw = TaggerClass::CreateTagger( arg );

src/RunTagger.cxx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1170,19 +1170,19 @@ namespace Tagger {
11701170
}
11711171
if ( Opts.extract( 'D', value ) ){
11721172
if ( value == "LogSilent" ) {
1173-
cur_log->setlevel( LogSilent );
1173+
cur_log->set_level( LogSilent );
11741174
}
11751175
else if ( value == "LogNormal" ){
1176-
cur_log->setlevel( LogNormal );
1176+
cur_log->set_level( LogNormal );
11771177
}
11781178
else if ( value == "LogDebug" ){
1179-
cur_log->setlevel( LogDebug );
1179+
cur_log->set_level( LogDebug );
11801180
}
11811181
else if ( value == "LogHeavy" ){
1182-
cur_log->setlevel( LogHeavy );
1182+
cur_log->set_level( LogHeavy );
11831183
}
11841184
else if ( value == "LogExtreme" ){
1185-
cur_log->setlevel( LogExtreme );
1185+
cur_log->set_level( LogExtreme );
11861186
}
11871187
else {
11881188
cerr << "Unknown Debug mode! (-D " << value << ")" << endl;

src/Tagger.cxx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ using namespace std;
5555
using namespace icu;
5656

5757
LogStream default_log( cerr );
58-
LogStream default_cout( cout, "", NoStamp);
5958
LogStream *cur_log = &default_log; // fill the externals
59+
LogStream default_cout( cout );
6060

6161
LogLevel internal_default_level = LogNormal;
6262
LogLevel Tagger_Log_Level = internal_default_level;
@@ -78,9 +78,9 @@ namespace Tagger {
7878
TaggerClass::TaggerClass():
7979
cur_log(new LogStream( cerr ))
8080
{
81-
cur_log->setlevel( LogNormal );
82-
cur_log->setstamp( StampMessage );
83-
default_cout.setstamp( NoStamp );
81+
cur_log->set_level( LogNormal );
82+
cur_log->set_stamp( StampMessage );
83+
default_cout.set_stamp( NoStamp );
8484
KnownTree = NULL;
8585
unKnownTree = NULL;
8686
TimblOptStr = "+vS -FColumns K: -a IGTREE +D U: -a IB1 ";
@@ -186,7 +186,8 @@ namespace Tagger {
186186
if ( !cloned ){
187187
delete cur_log;
188188
}
189-
cur_log = new LogStream( os, "mbt-" );
189+
cur_log = new LogStream( &os );
190+
cur_log->add_message( "mbt-" );
190191
return true;
191192
}
192193

src/convert.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ using std::ws;
4242
using std::map;
4343
using std::string;
4444

45-
using string_map = map<string, string>;
45+
typedef map<string, string> string_map;
4646

4747
void fill_map( istream& in, string_map& map ){
4848
string tag, word;

0 commit comments

Comments
 (0)