Skip to content

Commit

Permalink
fix issue HIT-SCIR#183
Browse files Browse the repository at this point in the history
  • Loading branch information
Oneplus committed Sep 10, 2016
1 parent ef450e7 commit fdd4c6c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/parser.n/parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +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;
delete [] payload;

if (use_cluster) {
cluster4_types_alphabet.load(ifs);
Expand All @@ -457,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 fdd4c6c

Please sign in to comment.