Skip to content

Commit

Permalink
Merge pull request HIT-SCIR#187 from HIT-SCIR/issue-183
Browse files Browse the repository at this point in the history
Issue 183
  • Loading branch information
Oneplus authored Sep 24, 2016
2 parents 82180f6 + fdd4c6c commit 4296e6b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/parser.n/parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,7 @@ bool NeuralNetworkParser::load(const std::string& filename) {
for (size_t i = 0; i < now; i += 2) {
precomputation_id_encoder[payload[i]] = payload[i+1];
}
delete [] payload;

if (use_cluster) {
cluster4_types_alphabet.load(ifs);
Expand All @@ -456,23 +457,23 @@ bool NeuralNetworkParser::load(const std::string& filename) {
for (size_t i = 0; i < now; i += 2) {
form_to_cluster4[payload[i]] = payload[i+1];
}
delete payload;
delete [] payload;

now= read_uint(ifs);
payload = new int[now];
ifs.read(reinterpret_cast<char*>(payload), now*sizeof(int));
for (size_t i = 0; i < now; i += 2) {
form_to_cluster6[payload[i]] = payload[i+1];
}
delete payload;
delete [] payload;

now= read_uint(ifs);
payload = new int[now];
ifs.read(reinterpret_cast<char*>(payload), now*sizeof(int));
for (size_t i = 0; i < now; i += 2) {
form_to_cluster[payload[i]] = payload[i+1];
}
delete payload;
delete [] payload;
}

classifier.canonical();
Expand Down

0 comments on commit 4296e6b

Please sign in to comment.