Skip to content

Commit

Permalink
merge bug fix by gcniu
Browse files Browse the repository at this point in the history
  • Loading branch information
Oneplus committed Sep 27, 2013
1 parent 4b53795 commit 02ab8a0
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/parser/parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#if _WIN32
#include <Windows.h>
#define sleep Sleep
#endif // end for _WIN32
#endif // end for _WIN32

namespace ltp {
namespace parser {
Expand Down
8 changes: 5 additions & 3 deletions src/parser/parser_dll.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,9 @@ class ParserWrapper : public ltp::parser::Parser {

ltp::parser::Parser::extract_features(inst);
ltp::parser::Parser::calculate_score(inst, ltp::parser::Parser::model->param);
ltp::parser::Decoder * deco;
deco=build_decoder();

ltp::parser::Decoder * deco;
deco = build_decoder();
deco->decode(inst);

int len = inst->size();
Expand All @@ -64,7 +65,8 @@ class ParserWrapper : public ltp::parser::Parser {
}

delete inst;
delete deco;
delete deco;

return inst->size();
}
};
Expand Down
7 changes: 2 additions & 5 deletions src/srl/DepSRL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,7 @@ int DepSRL::GetSRLResult(
const LTPData &ltpData,
const vector<int> &predicates,
vector< pair< int, vector< pair< string, pair< int, int > > > > > &vecSRLResult,
SRLBaselineExt * m_srlBaseline
)
{
SRLBaselineExt * m_srlBaseline) {
vecSRLResult.clear();

if ( !m_resourceLoaded ) {
Expand Down Expand Up @@ -155,7 +153,7 @@ int DepSRL::ExtractSrlFeatures(
const vector<int> &VecAllPredicates,
VecFeatForSent &vecAllFeatures,
VecPosForSent &vecAllPos,
SRLBaselineExt* m_srlBaseline
SRLBaselineExt* m_srlBaseline
)
{
vecAllFeatures.clear();
Expand Down Expand Up @@ -892,4 +890,3 @@ int DepSRL::RenameArguments(

return 1;
}

16 changes: 9 additions & 7 deletions src/srl/DepSRL.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,12 @@ class DepSRL {
const LTPData &ltpData,
const vector<int> &predicates,
vector< pair< int, vector< pair< string, pair< int, int > > > > > &vecSRLResult,
SRLBaselineExt * m_srlBaseline
SRLBaselineExt * m_srlBaseline
);
string GetConfigXml();
string GetSelectFeats();

string GetConfigXml();
string GetSelectFeats();

private:
/* 1.Extract SRL Features from input
*/
Expand All @@ -82,7 +84,7 @@ class DepSRL {
const vector<int> &VecAllPredicates,
VecFeatForSent &vecAllFeatures,
VecPosForSent &vecAllPos,
SRLBaselineExt* m_srlBaseline
SRLBaselineExt* m_srlBaseline
);

/* 2.Predict with the maxent library
Expand Down Expand Up @@ -243,11 +245,11 @@ class DepSRL {

private:
bool m_resourceLoaded;
string m_configXml;
string m_selectFeats;

string m_configXml;
string m_selectFeats;
maxent::ME_Model *m_srlModel; // for role labeling
maxent::ME_Model *m_prgModel; // for predicate recognition
};

#endif

0 comments on commit 02ab8a0

Please sign in to comment.