Remove SegmenterInterface as its Segmenter is the only derived class.
Benefits:
- Virtual method call is removed (especially IsBoundary is called
heavily so its cost is reduced)
- Reduce the number of files to be maintained
This is just a code cleanup. Hence no behavior change should occur.
BUG=none
TEST=unittest
Noriyuki Takahashi authored 9 years ago
Yohei Yukawa committed 9 years ago
51 | 51 | 'converter_base.gyp:conversion_request', |
52 | 52 | 'converter_base.gyp:immutable_converter', |
53 | 53 | 'converter_base.gyp:immutable_converter_interface', |
54 | 'converter_base.gyp:segmenter', | |
54 | 55 | 'converter_base.gyp:segments', |
55 | 56 | ], |
56 | 57 | }, |
85 | 85 | '../transliteration/transliteration.gyp:transliteration', |
86 | 86 | 'connector', |
87 | 87 | 'lattice', |
88 | 'segmenter', | |
88 | 89 | ], |
89 | 90 | }, |
90 | 91 | { |
126 | 127 | '../session/session_base.gyp:session_protocol', |
127 | 128 | 'connector', |
128 | 129 | 'immutable_converter_interface', |
130 | 'segmenter', | |
129 | 131 | 'segments', |
130 | 132 | ], |
131 | 133 | }, |
47 | 47 | #include "converter/immutable_converter_interface.h" |
48 | 48 | #include "converter/node.h" |
49 | 49 | #include "converter/segmenter.h" |
50 | #include "converter/segmenter_interface.h" | |
51 | 50 | #include "converter/segments.h" |
52 | 51 | #include "data_manager/data_manager_interface.h" |
53 | 52 | #include "data_manager/testing/mock_data_manager.h" |
176 | 175 | scoped_ptr<SuppressionDictionary> suppression_dictionary; |
177 | 176 | scoped_ptr<DictionaryInterface> suffix_dictionary; |
178 | 177 | scoped_ptr<const Connector> connector; |
179 | scoped_ptr<const SegmenterInterface> segmenter; | |
178 | scoped_ptr<const Segmenter> segmenter; | |
180 | 179 | scoped_ptr<DictionaryInterface> dictionary; |
181 | 180 | scoped_ptr<const PosGroup> pos_group; |
182 | 181 | scoped_ptr<const SuggestionFilter> suggestion_filter; |
1243 | 1242 | CreateSuffixDictionaryFromDataManager(data_manager)); |
1244 | 1243 | scoped_ptr<const Connector> connector( |
1245 | 1244 | Connector::CreateFromDataManager(data_manager)); |
1246 | scoped_ptr<const SegmenterInterface> segmenter( | |
1245 | scoped_ptr<const Segmenter> segmenter( | |
1247 | 1246 | Segmenter::CreateFromDataManager(data_manager)); |
1248 | 1247 | scoped_ptr<const SuggestionFilter> suggestion_filter( |
1249 | 1248 | CreateSuggestionFilter(data_manager)); |
51 | 51 | #include "converter/node.h" |
52 | 52 | #include "converter/node_allocator.h" |
53 | 53 | #include "converter/node_list_builder.h" |
54 | #include "converter/segmenter_interface.h" | |
54 | #include "converter/segmenter.h" | |
55 | 55 | #include "converter/segments.h" |
56 | 56 | #include "dictionary/dictionary_interface.h" |
57 | 57 | #include "dictionary/pos_group.h" |
274 | 274 | const DictionaryInterface *suffix_dictionary, |
275 | 275 | const SuppressionDictionary *suppression_dictionary, |
276 | 276 | const Connector *connector, |
277 | const SegmenterInterface *segmenter, | |
277 | const Segmenter *segmenter, | |
278 | 278 | const POSMatcher *pos_matcher, |
279 | 279 | const PosGroup *pos_group, |
280 | 280 | const SuggestionFilter *suggestion_filter) |
649 | 649 | if ((lnode->value.size() + rnode->value.size()) |
650 | 650 | == compound_node->value.size() && |
651 | 651 | (lnode->value + rnode->value) == compound_node->value && |
652 | segmenter_->IsBoundary(lnode, rnode, false)) { // Constraint 3. | |
652 | segmenter_->IsBoundary(*lnode, *rnode, false)) { // Constraint 3. | |
653 | 653 | const int32 cost = lnode->wcost + GetCost(lnode, rnode); |
654 | 654 | if (cost < best_cost) { // choose the smallest ones |
655 | 655 | best_last_name_node = lnode; |
1766 | 1766 | } |
1767 | 1767 | |
1768 | 1768 | // Grammatically segmented. |
1769 | if (segmenter_->IsBoundary(node, node->next, is_single_segment)) { | |
1769 | if (segmenter_->IsBoundary(*node, *node->next, is_single_segment)) { | |
1770 | 1770 | return true; |
1771 | 1771 | } |
1772 | 1772 |
50 | 50 | class NBestGenerator; |
51 | 51 | class POSMatcher; |
52 | 52 | class PosGroup; |
53 | class SegmenterInterface; | |
53 | class Segmenter; | |
54 | 54 | class SuggestionFilter; |
55 | 55 | |
56 | 56 | class ImmutableConverterImpl : public ImmutableConverterInterface { |
60 | 60 | const DictionaryInterface *suffix_dictionary, |
61 | 61 | const dictionary::SuppressionDictionary *suppression_dictionary, |
62 | 62 | const Connector *connector, |
63 | const SegmenterInterface *segmenter, | |
63 | const Segmenter *segmenter, | |
64 | 64 | const POSMatcher *pos_matcher, |
65 | 65 | const PosGroup *pos_group, |
66 | 66 | const SuggestionFilter *suggestion_filter); |
183 | 183 | const DictionaryInterface *suffix_dictionary_; |
184 | 184 | const dictionary::SuppressionDictionary *suppression_dictionary_; |
185 | 185 | const Connector *connector_; |
186 | const SegmenterInterface *segmenter_; | |
186 | const Segmenter *segmenter_; | |
187 | 187 | const POSMatcher *pos_matcher_; |
188 | 188 | const PosGroup *pos_group_; |
189 | 189 | const SuggestionFilter *suggestion_filter_; |
44 | 44 | #include "converter/conversion_request.h" |
45 | 45 | #include "converter/lattice.h" |
46 | 46 | #include "converter/segmenter.h" |
47 | #include "converter/segmenter_interface.h" | |
48 | 47 | #include "converter/segments.h" |
49 | 48 | #include "data_manager/data_manager_interface.h" |
50 | 49 | #include "data_manager/testing/mock_data_manager.h" |
162 | 161 | scoped_ptr<const DataManagerInterface> data_manager_; |
163 | 162 | scoped_ptr<const SuppressionDictionary> suppression_dictionary_; |
164 | 163 | scoped_ptr<const Connector> connector_; |
165 | scoped_ptr<const SegmenterInterface> segmenter_; | |
164 | scoped_ptr<const Segmenter> segmenter_; | |
166 | 165 | scoped_ptr<const DictionaryInterface> suffix_dictionary_; |
167 | 166 | scoped_ptr<const DictionaryInterface> dictionary_; |
168 | 167 | scoped_ptr<const PosGroup> pos_group_; |
38 | 38 | #include "converter/connector.h" |
39 | 39 | #include "converter/lattice.h" |
40 | 40 | #include "converter/node.h" |
41 | #include "converter/segmenter_interface.h" | |
41 | #include "converter/segmenter.h" | |
42 | 42 | #include "converter/segments.h" |
43 | 43 | #include "dictionary/pos_matcher.h" |
44 | 44 | |
105 | 105 | } |
106 | 106 | |
107 | 107 | NBestGenerator::NBestGenerator(const SuppressionDictionary *suppression_dic, |
108 | const SegmenterInterface *segmenter, | |
108 | const Segmenter *segmenter, | |
109 | 109 | const Connector *connector, |
110 | 110 | const POSMatcher *pos_matcher, |
111 | 111 | const Lattice *lattice, |
238 | 238 | const Node *lnode = nodes[i - 1]; |
239 | 239 | const Node *rnode = nodes[i]; |
240 | 240 | const bool kMultipleSegments = false; |
241 | if (segmenter_->IsBoundary(lnode, rnode, kMultipleSegments)) { | |
241 | if (segmenter_->IsBoundary(*lnode, *rnode, kMultipleSegments)) { | |
242 | 242 | candidate->PushBackInnerSegmentBoundary( |
243 | 243 | key_len, value_len, content_key_len, content_value_len); |
244 | 244 | key_len = 0; |
497 | 497 | // is_boundary is true if there is a grammer-based boundary |
498 | 498 | // between lnode and rnode |
499 | 499 | const bool is_boundary = (lnode->node_type == Node::HIS_NODE || |
500 | segmenter_->IsBoundary(lnode, rnode, false)); | |
500 | segmenter_->IsBoundary(*lnode, *rnode, false)); | |
501 | 501 | if (!is_edge && is_boundary) { |
502 | 502 | // There is a boundary within the segment. |
503 | 503 | return INVALID; |
524 | 524 | // between lnode and rnode |
525 | 525 | const bool is_boundary = ( |
526 | 526 | lnode->node_type == Node::HIS_NODE || |
527 | segmenter_->IsBoundary(lnode, rnode, true)); | |
527 | segmenter_->IsBoundary(*lnode, *rnode, true)); | |
528 | 528 | if (is_edge != is_boundary) { |
529 | 529 | // on the edge, have a boudnary. |
530 | 530 | // not on the edge, not the case. |
546 | 546 | // between lnode and rnode |
547 | 547 | const bool is_boundary = ( |
548 | 548 | lnode->node_type == Node::HIS_NODE || |
549 | segmenter_->IsBoundary(lnode, rnode, false)); | |
549 | segmenter_->IsBoundary(*lnode, *rnode, false)); | |
550 | 550 | |
551 | 551 | if (is_edge != is_boundary) { |
552 | 552 | // on the edge, have a boudnary. |
44 | 44 | class Connector; |
45 | 45 | class Lattice; |
46 | 46 | class POSMatcher; |
47 | class SegmenterInterface; | |
47 | class Segmenter; | |
48 | 48 | class SuggestionFilter; |
49 | 49 | struct Node; |
50 | 50 | |
81 | 81 | // Try to enumurate N-best results between begin_node and end_node. |
82 | 82 | NBestGenerator( |
83 | 83 | const dictionary::SuppressionDictionary *suppression_dictionary, |
84 | const SegmenterInterface *segmenter, | |
84 | const Segmenter *segmenter, | |
85 | 85 | const Connector *connector, |
86 | 86 | const POSMatcher *pos_matcher, |
87 | 87 | const Lattice *lattice, |
170 | 170 | |
171 | 171 | // References to relevant modules. |
172 | 172 | const dictionary::SuppressionDictionary *suppression_dictionary_; |
173 | const SegmenterInterface *segmenter_; | |
173 | const Segmenter *segmenter_; | |
174 | 174 | const Connector *connector_; |
175 | 175 | const POSMatcher *pos_matcher_; |
176 | 176 | const Lattice *lattice_; |
40 | 40 | #include "converter/conversion_request.h" |
41 | 41 | #include "converter/immutable_converter.h" |
42 | 42 | #include "converter/segmenter.h" |
43 | #include "converter/segmenter_interface.h" | |
44 | 43 | #include "converter/segments.h" |
45 | 44 | #include "data_manager/data_manager_interface.h" |
46 | 45 | #include "data_manager/testing/mock_data_manager.h" |
144 | 143 | scoped_ptr<const DataManagerInterface> data_manager_; |
145 | 144 | scoped_ptr<const SuppressionDictionary> suppression_dictionary_; |
146 | 145 | scoped_ptr<const Connector> connector_; |
147 | scoped_ptr<const SegmenterInterface> segmenter_; | |
146 | scoped_ptr<const Segmenter> segmenter_; | |
148 | 147 | scoped_ptr<const DictionaryInterface> suffix_dictionary_; |
149 | 148 | scoped_ptr<const DictionaryInterface> dictionary_; |
150 | 149 | scoped_ptr<const PosGroup> pos_group_; |
41 | 41 | const DataManagerInterface &data_manager) { |
42 | 42 | size_t l_num_elements = 0; |
43 | 43 | size_t r_num_elements = 0; |
44 | const uint16 *l_table = NULL; | |
45 | const uint16 *r_table = NULL; | |
44 | const uint16 *l_table = nullptr; | |
45 | const uint16 *r_table = nullptr; | |
46 | 46 | size_t bitarray_num_bytes = 0; |
47 | const char *bitarray_data = NULL; | |
48 | const BoundaryData *boundary_data = NULL; | |
47 | const char *bitarray_data = nullptr; | |
48 | const BoundaryData *boundary_data = nullptr; | |
49 | 49 | data_manager.GetSegmenterData(&l_num_elements, &r_num_elements, |
50 | 50 | &l_table, &r_table, |
51 | 51 | &bitarray_num_bytes, &bitarray_data, |
73 | 73 | |
74 | 74 | Segmenter::~Segmenter() {} |
75 | 75 | |
76 | bool Segmenter::IsBoundary(const Node *lnode, const Node *rnode, | |
76 | bool Segmenter::IsBoundary(const Node &lnode, const Node &rnode, | |
77 | 77 | bool is_single_segment) const { |
78 | DCHECK(lnode); | |
79 | DCHECK(rnode); | |
80 | if (lnode->node_type == Node::BOS_NODE || | |
81 | rnode->node_type == Node::EOS_NODE) { | |
78 | if (lnode.node_type == Node::BOS_NODE || | |
79 | rnode.node_type == Node::EOS_NODE) { | |
82 | 80 | return true; |
83 | 81 | } |
84 | 82 | |
85 | // return always false in prediction mode. | |
83 | // Always return false in prediction mode. | |
86 | 84 | // This implies that converter always returns single-segment-result |
87 | 85 | // in prediction mode. |
88 | 86 | if (is_single_segment) { |
96 | 94 | // If we segment "に書く" into two segments, "二角" is never be shown. |
97 | 95 | // There exits some implicit assumpution that user expects that his/her input |
98 | 96 | // becomes one bunsetu. So, it would be better to keep "二角" even after "紙". |
99 | if (lnode->attributes & Node::STARTS_WITH_PARTICLE) { | |
97 | if (lnode.attributes & Node::STARTS_WITH_PARTICLE) { | |
100 | 98 | return false; |
101 | 99 | } |
102 | 100 | |
103 | return IsBoundary(lnode->rid, rnode->lid); | |
101 | return IsBoundary(lnode.rid, rnode.lid); | |
104 | 102 | } |
105 | 103 | |
106 | 104 | bool Segmenter::IsBoundary(uint16 rid, uint16 lid) const { |
30 | 30 | #define MOZC_CONVERTER_SEGMENTER_H_ |
31 | 31 | |
32 | 32 | #include "base/port.h" |
33 | #include "converter/segmenter_interface.h" | |
34 | 33 | |
35 | 34 | namespace mozc { |
36 | 35 | |
38 | 37 | struct Node; |
39 | 38 | struct BoundaryData; |
40 | 39 | |
41 | class Segmenter : public SegmenterInterface { | |
40 | class Segmenter { | |
42 | 41 | public: |
43 | 42 | static Segmenter *CreateFromDataManager( |
44 | 43 | const DataManagerInterface &data_manager); |
48 | 47 | const uint16 *l_table, const uint16 *r_table, |
49 | 48 | size_t bitarray_num_bytes, const char *bitarray_data, |
50 | 49 | const BoundaryData *boundary_data); |
51 | virtual ~Segmenter(); | |
50 | ~Segmenter(); | |
52 | 51 | |
53 | virtual bool IsBoundary(const Node *lnode, const Node *rnode, | |
54 | bool is_single_segment) const; | |
52 | bool IsBoundary(const Node &lnode, const Node &rnode, | |
53 | bool is_single_segment) const; | |
55 | 54 | |
56 | virtual bool IsBoundary(uint16 rid, uint16 lid) const; | |
55 | bool IsBoundary(uint16 rid, uint16 lid) const; | |
57 | 56 | |
58 | virtual int32 GetPrefixPenalty(uint16 lid) const; | |
57 | int32 GetPrefixPenalty(uint16 lid) const; | |
59 | 58 | |
60 | virtual int32 GetSuffixPenalty(uint16 rid) const; | |
59 | int32 GetSuffixPenalty(uint16 rid) const; | |
61 | 60 | |
62 | 61 | private: |
63 | 62 | const size_t l_num_elements_; |
67 | 66 | const size_t bitarray_num_bytes_; |
68 | 67 | const char *bitarray_data_; |
69 | 68 | const BoundaryData *boundary_data_; |
69 | ||
70 | DISALLOW_COPY_AND_ASSIGN(Segmenter); | |
70 | 71 | }; |
71 | 72 | |
72 | 73 | } // namespace mozc |
0 | // Copyright 2010-2015, Google Inc. | |
1 | // All rights reserved. | |
2 | // | |
3 | // Redistribution and use in source and binary forms, with or without | |
4 | // modification, are permitted provided that the following conditions are | |
5 | // met: | |
6 | // | |
7 | // * Redistributions of source code must retain the above copyright | |
8 | // notice, this list of conditions and the following disclaimer. | |
9 | // * Redistributions in binary form must reproduce the above | |
10 | // copyright notice, this list of conditions and the following disclaimer | |
11 | // in the documentation and/or other materials provided with the | |
12 | // distribution. | |
13 | // * Neither the name of Google Inc. nor the names of its | |
14 | // contributors may be used to endorse or promote products derived from | |
15 | // this software without specific prior written permission. | |
16 | // | |
17 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
18 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
19 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
20 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
21 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
22 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
23 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
24 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
25 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
26 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
27 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
28 | ||
29 | #ifndef MOZC_CONVERTER_SEGMENTER_INTERFACE_H_ | |
30 | #define MOZC_CONVERTER_SEGMENTER_INTERFACE_H_ | |
31 | ||
32 | #include "base/port.h" | |
33 | ||
34 | namespace mozc { | |
35 | ||
36 | struct Node; | |
37 | ||
38 | class SegmenterInterface { | |
39 | public: | |
40 | virtual ~SegmenterInterface() {} | |
41 | ||
42 | // Returns true if there is a segment boundary between |lnode| and |rnode|. | |
43 | // If |is_single_segment| is true, this function basically reutrns false | |
44 | // unless |lnode| or |rnode| is BOS/EOS. |is_single_segment| is used for | |
45 | // prediction/suggestion mode. | |
46 | virtual bool IsBoundary(const Node *lnode, const Node *rnode, | |
47 | bool is_single_segment) const = 0; | |
48 | ||
49 | virtual bool IsBoundary(uint16 rid, uint16 lid) const = 0; | |
50 | ||
51 | // Returns cost penalty of the word prefix. We can add cost penalty if a | |
52 | // node->lid exists at the begging of user input. | |
53 | virtual int32 GetPrefixPenalty(uint16 lid) const = 0; | |
54 | ||
55 | // Returns cost penalty of the word suffix. We can add cost penalty if a | |
56 | // node->rid exists at the end of user input. | |
57 | virtual int32 GetSuffixPenalty(uint16 rid) const = 0; | |
58 | ||
59 | protected: | |
60 | SegmenterInterface() {} | |
61 | ||
62 | private: | |
63 | DISALLOW_COPY_AND_ASSIGN(SegmenterInterface); | |
64 | }; | |
65 | ||
66 | } // namespace mozc | |
67 | ||
68 | #endif // MOZC_CONVERTER_SEGMENTER_INTERFACE_H_ |
39 | 39 | #include "base/util.h" |
40 | 40 | #include "converter/connector.h" |
41 | 41 | #include "converter/node.h" |
42 | #include "converter/segmenter_base.h" | |
42 | #include "converter/segmenter.h" | |
43 | 43 | #include "data_manager/connection_file_reader.h" |
44 | 44 | #include "data_manager/data_manager_interface.h" |
45 | 45 | #include "dictionary/pos_matcher.h" |
104 | 104 | for (size_t lid = 0; lid < rsize_; ++lid) { |
105 | 105 | lnode.rid = rid; |
106 | 106 | lnode.lid = lid; |
107 | EXPECT_TRUE(segmenter->IsBoundary(&lnode, &rnode, false)); | |
108 | EXPECT_TRUE(segmenter->IsBoundary(&lnode, &rnode, true)); | |
107 | EXPECT_TRUE(segmenter->IsBoundary(lnode, rnode, false)); | |
108 | EXPECT_TRUE(segmenter->IsBoundary(lnode, rnode, true)); | |
109 | 109 | } |
110 | 110 | } |
111 | 111 | } |
122 | 122 | for (size_t lid = 0; lid < rsize_; ++lid) { |
123 | 123 | lnode.rid = rid; |
124 | 124 | lnode.lid = lid; |
125 | EXPECT_TRUE(segmenter->IsBoundary(&lnode, &rnode, false)); | |
126 | EXPECT_TRUE(segmenter->IsBoundary(&lnode, &rnode, true)); | |
125 | EXPECT_TRUE(segmenter->IsBoundary(lnode, rnode, false)); | |
126 | EXPECT_TRUE(segmenter->IsBoundary(lnode, rnode, true)); | |
127 | 127 | } |
128 | 128 | } |
129 | 129 | } |
140 | 140 | lnode.rid = rid; |
141 | 141 | rnode.lid = lid; |
142 | 142 | EXPECT_EQ(segmenter->IsBoundary(rid, lid), |
143 | segmenter->IsBoundary(&lnode, &rnode, false)); | |
144 | EXPECT_FALSE(segmenter->IsBoundary(&lnode, &rnode, true)); | |
143 | segmenter->IsBoundary(lnode, rnode, false)); | |
144 | EXPECT_FALSE(segmenter->IsBoundary(lnode, rnode, true)); | |
145 | 145 | } |
146 | 146 | } |
147 | 147 | } |
160 | 160 | lnode.rid = pos_matcher->GetAcceptableParticleAtBeginOfSegmentId(); |
161 | 161 | // "名詞,サ変". |
162 | 162 | rnode.lid = pos_matcher->GetUnknownId(); |
163 | EXPECT_TRUE(segmenter->IsBoundary(&lnode, &rnode, false)); | |
163 | EXPECT_TRUE(segmenter->IsBoundary(lnode, rnode, false)); | |
164 | 164 | |
165 | 165 | lnode.attributes |= Node::STARTS_WITH_PARTICLE; |
166 | EXPECT_FALSE(segmenter->IsBoundary(&lnode, &rnode, false)); | |
166 | EXPECT_FALSE(segmenter->IsBoundary(lnode, rnode, false)); | |
167 | 167 | } |
168 | 168 | |
169 | 169 | void DataManagerTestBase::ConnectorTest_RandomValueCheck() { |
44 | 44 | class ImmutableConverterInterface; |
45 | 45 | class PredictorInterface; |
46 | 46 | class RewriterInterface; |
47 | class SegmenterInterface; | |
47 | class Segmenter; | |
48 | 48 | class SuggestionFilter; |
49 | 49 | class UserDataManagerInterface; |
50 | 50 | |
77 | 77 | private: |
78 | 78 | scoped_ptr<dictionary::SuppressionDictionary> suppression_dictionary_; |
79 | 79 | scoped_ptr<const Connector> connector_; |
80 | scoped_ptr<const SegmenterInterface> segmenter_; | |
80 | scoped_ptr<const Segmenter> segmenter_; | |
81 | 81 | scoped_ptr<dictionary::UserDictionary> user_dictionary_; |
82 | 82 | scoped_ptr<DictionaryInterface> suffix_dictionary_; |
83 | 83 | scoped_ptr<DictionaryInterface> dictionary_; |
0 | 0 | MAJOR=2 |
1 | 1 | MINOR=17 |
2 | BUILD=2085 | |
2 | BUILD=2086 | |
3 | 3 | REVISION=102 |
4 | 4 | # NACL_DICTIONARY_VERSION is the target version of the system dictionary to be |
5 | 5 | # downloaded by NaCl Mozc. |
51 | 51 | #include "converter/converter_interface.h" |
52 | 52 | #include "converter/immutable_converter_interface.h" |
53 | 53 | #include "converter/node_list_builder.h" |
54 | #include "converter/segmenter_interface.h" | |
54 | #include "converter/segmenter.h" | |
55 | 55 | #include "converter/segments.h" |
56 | 56 | #include "dictionary/dictionary_interface.h" |
57 | 57 | #include "dictionary/pos_matcher.h" |
293 | 293 | const DictionaryInterface *dictionary, |
294 | 294 | const DictionaryInterface *suffix_dictionary, |
295 | 295 | const Connector *connector, |
296 | const SegmenterInterface *segmenter, | |
296 | const Segmenter *segmenter, | |
297 | 297 | const POSMatcher *pos_matcher, |
298 | 298 | const SuggestionFilter *suggestion_filter) |
299 | 299 | : converter_(converter), |
47 | 47 | class DictionaryInterface; |
48 | 48 | class ImmutableConverterInterface; |
49 | 49 | class POSMatcher; |
50 | class SegmenterInterface; | |
50 | class Segmenter; | |
51 | 51 | class Segments; |
52 | 52 | class SuggestionFilter; |
53 | 53 | |
61 | 61 | const DictionaryInterface *dictionary, |
62 | 62 | const DictionaryInterface *suffix_dictionary, |
63 | 63 | const Connector *connector, |
64 | const SegmenterInterface *segmenter, | |
64 | const Segmenter *segmenter, | |
65 | 65 | const POSMatcher *pos_matcher, |
66 | 66 | const SuggestionFilter *suggestion_filter); |
67 | 67 | virtual ~DictionaryPredictor(); |
423 | 423 | const DictionaryInterface *dictionary_; |
424 | 424 | const DictionaryInterface *suffix_dictionary_; |
425 | 425 | const Connector *connector_; |
426 | const SegmenterInterface *segmenter_; | |
426 | const Segmenter *segmenter_; | |
427 | 427 | const SuggestionFilter *suggestion_filter_; |
428 | 428 | const uint16 counter_suffix_word_id_; |
429 | 429 | const string predictor_name_; |
156 | 156 | const DictionaryInterface *dictionary, |
157 | 157 | const DictionaryInterface *suffix_dictionary, |
158 | 158 | const Connector *connector, |
159 | const SegmenterInterface *segmenter, | |
159 | const Segmenter *segmenter, | |
160 | 160 | const POSMatcher *pos_matcher, |
161 | 161 | const SuggestionFilter *suggestion_filter) |
162 | 162 | : DictionaryPredictor(converter, |
268 | 268 | const POSMatcher *pos_matcher_; |
269 | 269 | scoped_ptr<SuppressionDictionary> suppression_dictionary_; |
270 | 270 | scoped_ptr<const Connector> connector_; |
271 | scoped_ptr<const SegmenterInterface> segmenter_; | |
271 | scoped_ptr<const Segmenter> segmenter_; | |
272 | 272 | scoped_ptr<const DictionaryInterface> suffix_dictionary_; |
273 | 273 | scoped_ptr<const DictionaryInterface> dictionary_; |
274 | 274 | DictionaryMock *dictionary_mock_; |
1560 | 1560 | CreateSuffixDictionaryFromDataManager(data_manager)); |
1561 | 1561 | scoped_ptr<const Connector> connector( |
1562 | 1562 | Connector::CreateFromDataManager(data_manager)); |
1563 | scoped_ptr<const SegmenterInterface> segmenter( | |
1563 | scoped_ptr<const Segmenter> segmenter( | |
1564 | 1564 | Segmenter::CreateFromDataManager(data_manager)); |
1565 | 1565 | scoped_ptr<const SuggestionFilter> suggestion_filter( |
1566 | 1566 | CreateSuggestionFilter(data_manager)); |
3132 | 3132 | CreateSuffixDictionaryFromDataManager(data_manager)); |
3133 | 3133 | scoped_ptr<const Connector> connector( |
3134 | 3134 | Connector::CreateFromDataManager(data_manager)); |
3135 | scoped_ptr<const SegmenterInterface> segmenter( | |
3135 | scoped_ptr<const Segmenter> segmenter( | |
3136 | 3136 | Segmenter::CreateFromDataManager(data_manager)); |
3137 | 3137 | scoped_ptr<const SuggestionFilter> suggestion_filter( |
3138 | 3138 | CreateSuggestionFilter(data_manager)); |
48 | 48 | '../composer/composer.gyp:composer', |
49 | 49 | '../converter/converter_base.gyp:conversion_request', |
50 | 50 | '../converter/converter_base.gyp:immutable_converter', |
51 | '../converter/converter_base.gyp:segmenter', | |
51 | 52 | '../converter/converter_base.gyp:segments', |
52 | 53 | '../dictionary/dictionary.gyp:dictionary', |
53 | 54 | '../dictionary/dictionary.gyp:suffix_dictionary', |