Skip to content

Commit f073c8e

Browse files
committed
Remove boost regex
1 parent b524312 commit f073c8e

File tree

1 file changed

+53
-51
lines changed

1 file changed

+53
-51
lines changed

lima_linguisticprocessing/tools/evalCoref/evalCoref.cpp

Lines changed: 53 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -295,57 +295,59 @@ void init(string csvFile, vector<set<string> >*corefChains, NamedBoundsMap* BMap
295295
match_results<std::string::const_iterator> what;
296296
while( getline(fin,line) )
297297
{
298-
string::const_iterator start = line.begin();
299-
string::const_iterator end = line.end();
300-
if (regex_search(start, end, what, expression))
301-
{
302-
string id = string(what[1].first, what[1].second);
303-
string ref = string(what[2].first, what[2].second);
304-
string text = string(what[5].first, what[5].second);
305-
bool definites = string(what[6].first, what[6].second)!="other"
306-
&& string(what[6].first, what[6].second)!="reflPron";
307-
float boundA = atoi(string(what[3].first, what[3].second).c_str());
308-
float boundB = atoi(string(what[4].first, what[4].second).c_str());
309-
BMap->insert(make_pair(id, make_pair(boundA, boundB)));
310-
TMap->insert(make_pair(id, text));
311-
DMap->insert(make_pair(id, definites));
312-
313-
if (ref != "")
314-
{
315-
bool inserted = false;
316-
for (vector<set<string> >::iterator it = corefChains->begin(); it!=corefChains->end();it++)
317-
{
318-
if ((*it).find(ref)!=(*it).end())
319-
{
320-
(*it).insert(id);
321-
inserted = true;
322-
break;
323-
}
324-
}
325-
if (!inserted)
326-
{
327-
for (vector<set<string> >::iterator it = corefChains->begin(); it!=corefChains->end();it++)
328-
{
329-
if ((*it).find(id)!=(*it).end())
330-
{
331-
(*it).insert(ref);
332-
inserted = true;
333-
break;
334-
}
335-
}
336-
}
337-
if (!inserted)
338-
{
339-
corefChains->push_back(set<string>());
340-
(*corefChains->rbegin()).insert(id);
341-
(*corefChains->rbegin()).insert(ref);
342-
}
343-
}
344-
}
345-
else
346-
{
347-
std::cerr << "Error matching reference file line '"<<line<<"'" << std::endl;
348-
}
298+
// TODO lines below fails to compile with boost 1.66 and c++20 in manylinux
299+
// TODO replace boost regex by QRegularExpression
300+
// string::const_iterator start = line.begin();
301+
// string::const_iterator end = line.end();
302+
// if (regex_search(start, end, what, expression))
303+
// {
304+
// string id = string(what[1].first, what[1].second);
305+
// string ref = string(what[2].first, what[2].second);
306+
// string text = string(what[5].first, what[5].second);
307+
// bool definites = string(what[6].first, what[6].second)!="other"
308+
// && string(what[6].first, what[6].second)!="reflPron";
309+
// float boundA = atoi(string(what[3].first, what[3].second).c_str());
310+
// float boundB = atoi(string(what[4].first, what[4].second).c_str());
311+
// BMap->insert(make_pair(id, make_pair(boundA, boundB)));
312+
// TMap->insert(make_pair(id, text));
313+
// DMap->insert(make_pair(id, definites));
314+
//
315+
// if (ref != "")
316+
// {
317+
// bool inserted = false;
318+
// for (vector<set<string> >::iterator it = corefChains->begin(); it!=corefChains->end();it++)
319+
// {
320+
// if ((*it).find(ref)!=(*it).end())
321+
// {
322+
// (*it).insert(id);
323+
// inserted = true;
324+
// break;
325+
// }
326+
// }
327+
// if (!inserted)
328+
// {
329+
// for (vector<set<string> >::iterator it = corefChains->begin(); it!=corefChains->end();it++)
330+
// {
331+
// if ((*it).find(id)!=(*it).end())
332+
// {
333+
// (*it).insert(ref);
334+
// inserted = true;
335+
// break;
336+
// }
337+
// }
338+
// }
339+
// if (!inserted)
340+
// {
341+
// corefChains->push_back(set<string>());
342+
// (*corefChains->rbegin()).insert(id);
343+
// (*corefChains->rbegin()).insert(ref);
344+
// }
345+
// }
346+
// }
347+
// else
348+
// {
349+
// std::cerr << "Error matching reference file line '"<<line<<"'" << std::endl;
350+
// }
349351
}
350352
// for (vector<set<string> >::iterator it1 = corefChains->begin(); it1!=corefChains->end();it1++)
351353
// {

0 commit comments

Comments
 (0)