File tree 2 files changed +6
-10
lines changed
2 files changed +6
-10
lines changed Original file line number Diff line number Diff line change @@ -796,7 +796,7 @@ LanguageModelDawgInfo *LanguageModel::GenerateDawgInfo(
796
796
dawg_args_->permuter = NO_PERM;
797
797
} else {
798
798
if (parent_vse->dawg_info == NULL ) return NULL ; // not a dict word path
799
- dawg_args_->active_dawgs = parent_vse->dawg_info ->active_dawgs ;
799
+ dawg_args_->active_dawgs = & parent_vse->dawg_info ->active_dawgs ;
800
800
dawg_args_->permuter = parent_vse->dawg_info ->permuter ;
801
801
}
802
802
@@ -822,8 +822,8 @@ LanguageModelDawgInfo *LanguageModel::GenerateDawgInfo(
822
822
int i;
823
823
// Check a that the path terminated before the current character is a word.
824
824
bool has_word_ending = false ;
825
- for (i = 0 ; i < parent_vse->dawg_info ->active_dawgs -> size (); ++i) {
826
- const DawgPosition &pos = (* parent_vse->dawg_info ->active_dawgs ) [i];
825
+ for (i = 0 ; i < parent_vse->dawg_info ->active_dawgs . size (); ++i) {
826
+ const DawgPosition &pos = parent_vse->dawg_info ->active_dawgs [i];
827
827
const Dawg *pdawg = pos.dawg_index < 0
828
828
? NULL : dict_->GetDawg (pos.dawg_index );
829
829
if (pdawg == NULL || pos.back_to_punc ) continue ;;
Original file line number Diff line number Diff line change @@ -59,13 +59,9 @@ typedef unsigned char LanguageModelFlagsType;
59
59
// / component. It stores the set of active dawgs in which the sequence of
60
60
// / letters on a path can be found.
61
61
struct LanguageModelDawgInfo {
62
- LanguageModelDawgInfo (DawgPositionVector *a, PermuterType pt) : permuter(pt) {
63
- active_dawgs = new DawgPositionVector (*a);
64
- }
65
- ~LanguageModelDawgInfo () {
66
- delete active_dawgs;
67
- }
68
- DawgPositionVector *active_dawgs;
62
+ LanguageModelDawgInfo (const DawgPositionVector *a, PermuterType pt)
63
+ : active_dawgs(*a), permuter(pt) {}
64
+ DawgPositionVector active_dawgs;
69
65
PermuterType permuter;
70
66
};
71
67
You can’t perform that action at this time.
0 commit comments