Codebase list mozc / 235e989
Rename SegmenterBase to Segmenter as it's not used as a base class. 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
16 changed file(s) with 226 addition(s) and 228 deletion(s). Raw diff Collapse all Expand all
3838 },
3939 'targets': [
4040 {
41 'target_name': 'segmenter_base',
41 'target_name': 'segmenter',
4242 'type': 'static_library',
4343 'sources': [
44 'segmenter_base.cc',
44 'segmenter.cc',
4545 ],
4646 'dependencies': [
4747 '../base/base.gyp:base',
4646 #include "converter/immutable_converter.h"
4747 #include "converter/immutable_converter_interface.h"
4848 #include "converter/node.h"
49 #include "converter/segmenter_base.h"
49 #include "converter/segmenter.h"
5050 #include "converter/segmenter_interface.h"
5151 #include "converter/segments.h"
5252 #include "data_manager/data_manager_interface.h"
207207 ret->suffix_dictionary.reset(
208208 CreateSuffixDictionaryFromDataManager(data_manager));
209209 ret->connector.reset(Connector::CreateFromDataManager(data_manager));
210 ret->segmenter.reset(SegmenterBase::CreateFromDataManager(data_manager));
210 ret->segmenter.reset(Segmenter::CreateFromDataManager(data_manager));
211211 ret->immutable_converter.reset(
212212 new ImmutableConverterImpl(ret->dictionary.get(),
213213 ret->suffix_dictionary.get(),
12441244 scoped_ptr<const Connector> connector(
12451245 Connector::CreateFromDataManager(data_manager));
12461246 scoped_ptr<const SegmenterInterface> segmenter(
1247 SegmenterBase::CreateFromDataManager(data_manager));
1247 Segmenter::CreateFromDataManager(data_manager));
12481248 scoped_ptr<const SuggestionFilter> suggestion_filter(
12491249 CreateSuggestionFilter(data_manager));
12501250 scoped_ptr<ImmutableConverterInterface> immutable_converter(
6666 'converter.gyp:converter',
6767 'converter_base.gyp:connector',
6868 'converter_base.gyp:converter_mock',
69 'converter_base.gyp:segmenter_base',
69 'converter_base.gyp:segmenter',
7070 'converter_base.gyp:segments',
7171 ],
7272 'variables': {
4343 #include "converter/connector.h"
4444 #include "converter/conversion_request.h"
4545 #include "converter/lattice.h"
46 #include "converter/segmenter_base.h"
46 #include "converter/segmenter.h"
4747 #include "converter/segmenter_interface.h"
4848 #include "converter/segments.h"
4949 #include "data_manager/data_manager_interface.h"
129129 connector_.reset(Connector::CreateFromDataManager(*data_manager_));
130130 CHECK(connector_.get());
131131
132 segmenter_.reset(SegmenterBase::CreateFromDataManager(*data_manager_));
132 segmenter_.reset(Segmenter::CreateFromDataManager(*data_manager_));
133133 CHECK(segmenter_.get());
134134
135135 pos_group_.reset(new PosGroup(data_manager_->GetPosGroupData()));
3939 #include "converter/connector.h"
4040 #include "converter/conversion_request.h"
4141 #include "converter/immutable_converter.h"
42 #include "converter/segmenter_base.h"
42 #include "converter/segmenter.h"
4343 #include "converter/segmenter_interface.h"
4444 #include "converter/segments.h"
4545 #include "data_manager/data_manager_interface.h"
102102 connector_.reset(Connector::CreateFromDataManager(*data_manager_));
103103 CHECK(connector_.get());
104104
105 segmenter_.reset(SegmenterBase::CreateFromDataManager(*data_manager_));
105 segmenter_.reset(Segmenter::CreateFromDataManager(*data_manager_));
106106 CHECK(segmenter_.get());
107107
108108 pos_group_.reset(new PosGroup(data_manager_->GetPosGroupData()));
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 #include "converter/segmenter.h"
30
31 #include "base/bitarray.h"
32 #include "base/logging.h"
33 #include "base/port.h"
34 #include "converter/boundary_struct.h"
35 #include "converter/node.h"
36 #include "data_manager/data_manager_interface.h"
37
38 namespace mozc {
39
40 Segmenter *Segmenter::CreateFromDataManager(
41 const DataManagerInterface &data_manager) {
42 size_t l_num_elements = 0;
43 size_t r_num_elements = 0;
44 const uint16 *l_table = NULL;
45 const uint16 *r_table = NULL;
46 size_t bitarray_num_bytes = 0;
47 const char *bitarray_data = NULL;
48 const BoundaryData *boundary_data = NULL;
49 data_manager.GetSegmenterData(&l_num_elements, &r_num_elements,
50 &l_table, &r_table,
51 &bitarray_num_bytes, &bitarray_data,
52 &boundary_data);
53 return new Segmenter(l_num_elements, r_num_elements,
54 l_table, r_table,
55 bitarray_num_bytes, bitarray_data,
56 boundary_data);
57 }
58
59 Segmenter::Segmenter(
60 size_t l_num_elements, size_t r_num_elements, const uint16 *l_table,
61 const uint16 *r_table, size_t bitarray_num_bytes,
62 const char *bitarray_data, const BoundaryData *boundary_data)
63 : l_num_elements_(l_num_elements), r_num_elements_(r_num_elements),
64 l_table_(l_table), r_table_(r_table),
65 bitarray_num_bytes_(bitarray_num_bytes),
66 bitarray_data_(bitarray_data), boundary_data_(boundary_data) {
67 DCHECK(l_table_);
68 DCHECK(r_table_);
69 DCHECK(bitarray_data_);
70 DCHECK(boundary_data_);
71 CHECK_LE(l_num_elements_ * r_num_elements_, bitarray_num_bytes_ * 8);
72 }
73
74 Segmenter::~Segmenter() {}
75
76 bool Segmenter::IsBoundary(const Node *lnode, const Node *rnode,
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) {
82 return true;
83 }
84
85 // return always false in prediction mode.
86 // This implies that converter always returns single-segment-result
87 // in prediction mode.
88 if (is_single_segment) {
89 return false;
90 }
91
92 // Concatenate particle and content word into one segment,
93 // if lnode locates at the beginning of user input.
94 // This hack is for handling ambiguous bunsetsu segmentation.
95 // e.g. "かみ|にかく" => "紙|に書く" or "紙二角".
96 // If we segment "に書く" into two segments, "二角" is never be shown.
97 // There exits some implicit assumpution that user expects that his/her input
98 // becomes one bunsetu. So, it would be better to keep "二角" even after "紙".
99 if (lnode->attributes & Node::STARTS_WITH_PARTICLE) {
100 return false;
101 }
102
103 return IsBoundary(lnode->rid, rnode->lid);
104 }
105
106 bool Segmenter::IsBoundary(uint16 rid, uint16 lid) const {
107 const uint32 bitarray_index = l_table_[rid] + l_num_elements_ * r_table_[lid];
108 return BitArray::GetValue(reinterpret_cast<const char*>(bitarray_data_),
109 bitarray_index);
110 }
111
112 int32 Segmenter::GetPrefixPenalty(uint16 lid) const {
113 return boundary_data_[lid].prefix_penalty;
114 }
115
116 int32 Segmenter::GetSuffixPenalty(uint16 rid) const {
117 return boundary_data_[rid].suffix_penalty;
118 }
119
120 } // 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_H_
30 #define MOZC_CONVERTER_SEGMENTER_H_
31
32 #include "base/port.h"
33 #include "converter/segmenter_interface.h"
34
35 namespace mozc {
36
37 class DataManagerInterface;
38 struct Node;
39 struct BoundaryData;
40
41 class Segmenter : public SegmenterInterface {
42 public:
43 static Segmenter *CreateFromDataManager(
44 const DataManagerInterface &data_manager);
45
46 // This class does not take the ownership of pointer parameters.
47 Segmenter(size_t l_num_elements, size_t r_num_elements,
48 const uint16 *l_table, const uint16 *r_table,
49 size_t bitarray_num_bytes, const char *bitarray_data,
50 const BoundaryData *boundary_data);
51 virtual ~Segmenter();
52
53 virtual bool IsBoundary(const Node *lnode, const Node *rnode,
54 bool is_single_segment) const;
55
56 virtual bool IsBoundary(uint16 rid, uint16 lid) const;
57
58 virtual int32 GetPrefixPenalty(uint16 lid) const;
59
60 virtual int32 GetSuffixPenalty(uint16 rid) const;
61
62 private:
63 const size_t l_num_elements_;
64 const size_t r_num_elements_;
65 const uint16 *l_table_;
66 const uint16 *r_table_;
67 const size_t bitarray_num_bytes_;
68 const char *bitarray_data_;
69 const BoundaryData *boundary_data_;
70 };
71
72 } // namespace mozc
73
74 #endif // MOZC_CONVERTER_SEGMENTER_H_
+0
-120
src/converter/segmenter_base.cc less more
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 #include "converter/segmenter_base.h"
30
31 #include "base/bitarray.h"
32 #include "base/logging.h"
33 #include "base/port.h"
34 #include "converter/boundary_struct.h"
35 #include "converter/node.h"
36 #include "data_manager/data_manager_interface.h"
37
38 namespace mozc {
39
40 SegmenterBase *SegmenterBase::CreateFromDataManager(
41 const DataManagerInterface &data_manager) {
42 size_t l_num_elements = 0;
43 size_t r_num_elements = 0;
44 const uint16 *l_table = NULL;
45 const uint16 *r_table = NULL;
46 size_t bitarray_num_bytes = 0;
47 const char *bitarray_data = NULL;
48 const BoundaryData *boundary_data = NULL;
49 data_manager.GetSegmenterData(&l_num_elements, &r_num_elements,
50 &l_table, &r_table,
51 &bitarray_num_bytes, &bitarray_data,
52 &boundary_data);
53 return new SegmenterBase(l_num_elements, r_num_elements,
54 l_table, r_table,
55 bitarray_num_bytes, bitarray_data,
56 boundary_data);
57 }
58
59 SegmenterBase::SegmenterBase(
60 size_t l_num_elements, size_t r_num_elements, const uint16 *l_table,
61 const uint16 *r_table, size_t bitarray_num_bytes,
62 const char *bitarray_data, const BoundaryData *boundary_data)
63 : l_num_elements_(l_num_elements), r_num_elements_(r_num_elements),
64 l_table_(l_table), r_table_(r_table),
65 bitarray_num_bytes_(bitarray_num_bytes),
66 bitarray_data_(bitarray_data), boundary_data_(boundary_data) {
67 DCHECK(l_table_);
68 DCHECK(r_table_);
69 DCHECK(bitarray_data_);
70 DCHECK(boundary_data_);
71 CHECK_LE(l_num_elements_ * r_num_elements_, bitarray_num_bytes_ * 8);
72 }
73
74 SegmenterBase::~SegmenterBase() {}
75
76 bool SegmenterBase::IsBoundary(const Node *lnode, const Node *rnode,
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) {
82 return true;
83 }
84
85 // return always false in prediction mode.
86 // This implies that converter always returns single-segment-result
87 // in prediction mode.
88 if (is_single_segment) {
89 return false;
90 }
91
92 // Concatenate particle and content word into one segment,
93 // if lnode locates at the beginning of user input.
94 // This hack is for handling ambiguous bunsetsu segmentation.
95 // e.g. "かみ|にかく" => "紙|に書く" or "紙二角".
96 // If we segment "に書く" into two segments, "二角" is never be shown.
97 // There exits some implicit assumpution that user expects that his/her input
98 // becomes one bunsetu. So, it would be better to keep "二角" even after "紙".
99 if (lnode->attributes & Node::STARTS_WITH_PARTICLE) {
100 return false;
101 }
102
103 return IsBoundary(lnode->rid, rnode->lid);
104 }
105
106 bool SegmenterBase::IsBoundary(uint16 rid, uint16 lid) const {
107 const uint32 bitarray_index = l_table_[rid] + l_num_elements_ * r_table_[lid];
108 return BitArray::GetValue(reinterpret_cast<const char*>(bitarray_data_),
109 bitarray_index);
110 }
111
112 int32 SegmenterBase::GetPrefixPenalty(uint16 lid) const {
113 return boundary_data_[lid].prefix_penalty;
114 }
115
116 int32 SegmenterBase::GetSuffixPenalty(uint16 rid) const {
117 return boundary_data_[rid].suffix_penalty;
118 }
119 } // namespace mozc
+0
-76
src/converter/segmenter_base.h less more
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 // Segmenter implementation base class
30
31 #ifndef MOZC_CONVERTER_SEGMENTER_BASE_H_
32 #define MOZC_CONVERTER_SEGMENTER_BASE_H_
33
34 #include "base/port.h"
35 #include "converter/segmenter_interface.h"
36
37 namespace mozc {
38
39 class DataManagerInterface;
40 struct Node;
41 struct BoundaryData;
42
43 class SegmenterBase : public SegmenterInterface {
44 public:
45 static SegmenterBase *CreateFromDataManager(
46 const DataManagerInterface &data_manager);
47
48 // This class does not have the ownership of pointer parameters.
49 SegmenterBase(size_t l_num_elements, size_t r_num_elements,
50 const uint16 *l_table, const uint16 *r_table,
51 size_t bitarray_num_bytes, const char *bitarray_data,
52 const BoundaryData *boundary_data);
53 virtual ~SegmenterBase();
54
55 virtual bool IsBoundary(const Node *lnode, const Node *rnode,
56 bool is_single_segment) const;
57
58 virtual bool IsBoundary(uint16 rid, uint16 lid) const;
59
60 virtual int32 GetPrefixPenalty(uint16 lid) const;
61
62 virtual int32 GetSuffixPenalty(uint16 rid) const;
63
64 private:
65 const size_t l_num_elements_;
66 const size_t r_num_elements_;
67 const uint16 *l_table_;
68 const uint16 *r_table_;
69 const size_t bitarray_num_bytes_;
70 const char *bitarray_data_;
71 const BoundaryData *boundary_data_;
72 };
73
74 } // namespace mozc
75 #endif // MOZC_CONVERTER_SEGMENTER_BASE_H_
4141 'dependencies': [
4242 '../base/base.gyp:base',
4343 '../converter/converter_base.gyp:connector',
44 '../converter/converter_base.gyp:segmenter_base',
44 '../converter/converter_base.gyp:segmenter',
4545 '../dictionary/dictionary_base.gyp:pos_matcher',
4646 '../prediction/prediction_base.gyp:suggestion_filter',
4747 '../testing/testing.gyp:testing',
4040 #include "converter/connector.h"
4141 #include "converter/node.h"
4242 #include "converter/segmenter_base.h"
43 #include "converter/segmenter_interface.h"
4443 #include "data_manager/connection_file_reader.h"
4544 #include "data_manager/data_manager_interface.h"
4645 #include "dictionary/pos_matcher.h"
8382 void DataManagerTestBase::SegmenterTest_SameAsInternal() {
8483 // This test verifies that a segmenter created by MockDataManager provides
8584 // the expected boundary rule.
86 scoped_ptr<SegmenterInterface> segmenter(
87 SegmenterBase::CreateFromDataManager(*data_manager_));
85 scoped_ptr<Segmenter> segmenter(
86 Segmenter::CreateFromDataManager(*data_manager_));
8887 for (size_t rid = 0; rid < lsize_; ++rid) {
8988 for (size_t lid = 0; lid < rsize_; ++lid) {
9089 EXPECT_EQ(is_boundary_(rid, lid),
9493 }
9594
9695 void DataManagerTestBase::SegmenterTest_LNodeTest() {
97 scoped_ptr<SegmenterInterface> segmenter(
98 SegmenterBase::CreateFromDataManager(*data_manager_));
96 scoped_ptr<Segmenter> segmenter(
97 Segmenter::CreateFromDataManager(*data_manager_));
9998
10099 // lnode is BOS
101100 Node lnode, rnode;
112111 }
113112
114113 void DataManagerTestBase::SegmenterTest_RNodeTest() {
115 scoped_ptr<SegmenterInterface> segmenter(
116 SegmenterBase::CreateFromDataManager(*data_manager_));
114 scoped_ptr<Segmenter> segmenter(
115 Segmenter::CreateFromDataManager(*data_manager_));
117116
118117 // rnode is EOS
119118 Node lnode, rnode;
130129 }
131130
132131 void DataManagerTestBase::SegmenterTest_NodeTest() {
133 scoped_ptr<SegmenterInterface> segmenter(
134 SegmenterBase::CreateFromDataManager(*data_manager_));
132 scoped_ptr<Segmenter> segmenter(
133 Segmenter::CreateFromDataManager(*data_manager_));
135134
136135 Node lnode, rnode;
137136 lnode.node_type = Node::NOR_NODE;
148147 }
149148
150149 void DataManagerTestBase::SegmenterTest_ParticleTest() {
151 scoped_ptr<SegmenterInterface> segmenter(
152 SegmenterBase::CreateFromDataManager(*data_manager_));
150 scoped_ptr<Segmenter> segmenter(
151 Segmenter::CreateFromDataManager(*data_manager_));
153152 const POSMatcher *pos_matcher = data_manager_->GetPOSMatcher();
154153
155154 Node lnode, rnode;
3535 #include "converter/converter_interface.h"
3636 #include "converter/immutable_converter.h"
3737 #include "converter/immutable_converter_interface.h"
38 #include "converter/segmenter_base.h"
38 #include "converter/segmenter.h"
3939 #include "data_manager/data_manager_interface.h"
4040 #include "dictionary/dictionary_impl.h"
4141 #include "dictionary/dictionary_interface.h"
175175 connector_.reset(Connector::CreateFromDataManager(*data_manager));
176176 CHECK(connector_.get());
177177
178 segmenter_.reset(SegmenterBase::CreateFromDataManager(*data_manager));
178 segmenter_.reset(Segmenter::CreateFromDataManager(*data_manager));
179179 CHECK(segmenter_.get());
180180
181181 pos_group_.reset(new PosGroup(data_manager->GetPosGroupData()));
4343 '../base/base.gyp:base',
4444 '../converter/converter.gyp:converter',
4545 '../converter/converter_base.gyp:connector',
46 '../converter/converter_base.gyp:segmenter_base',
46 '../converter/converter_base.gyp:segmenter',
4747 '../dictionary/dictionary.gyp:dictionary_impl',
4848 '../dictionary/dictionary.gyp:suffix_dictionary',
4949 '../dictionary/dictionary_base.gyp:dictionary_protocol',
00 MAJOR=2
11 MINOR=17
2 BUILD=2084
2 BUILD=2085
33 REVISION=102
44 # NACL_DICTIONARY_VERSION is the target version of the system dictionary to be
55 # downloaded by NaCl Mozc.
5252 #include "converter/immutable_converter.h"
5353 #include "converter/immutable_converter_interface.h"
5454 #include "converter/node_allocator.h"
55 #include "converter/segmenter_base.h"
56 #include "converter/segmenter_interface.h"
55 #include "converter/segmenter.h"
5756 #include "converter/segments.h"
5857 #include "data_manager/data_manager_interface.h"
5958 #include "data_manager/testing/mock_data_manager.h"
223222 connector_.reset(Connector::CreateFromDataManager(data_manager));
224223 CHECK(connector_.get());
225224
226 segmenter_.reset(SegmenterBase::CreateFromDataManager(data_manager));
225 segmenter_.reset(Segmenter::CreateFromDataManager(data_manager));
227226 CHECK(segmenter_.get());
228227
229228 pos_group_.reset(new PosGroup(data_manager.GetPosGroupData()));
15621561 scoped_ptr<const Connector> connector(
15631562 Connector::CreateFromDataManager(data_manager));
15641563 scoped_ptr<const SegmenterInterface> segmenter(
1565 SegmenterBase::CreateFromDataManager(data_manager));
1564 Segmenter::CreateFromDataManager(data_manager));
15661565 scoped_ptr<const SuggestionFilter> suggestion_filter(
15671566 CreateSuggestionFilter(data_manager));
15681567 scoped_ptr<TestableDictionaryPredictor> predictor(
31343133 scoped_ptr<const Connector> connector(
31353134 Connector::CreateFromDataManager(data_manager));
31363135 scoped_ptr<const SegmenterInterface> segmenter(
3137 SegmenterBase::CreateFromDataManager(data_manager));
3136 Segmenter::CreateFromDataManager(data_manager));
31383137 scoped_ptr<const SuggestionFilter> suggestion_filter(
31393138 CreateSuggestionFilter(data_manager));
31403139 scoped_ptr<TestableDictionaryPredictor> predictor(
4646 '../converter/converter_base.gyp:connector',
4747 '../converter/converter_base.gyp:converter_mock',
4848 '../converter/converter_base.gyp:immutable_converter',
49 '../converter/converter_base.gyp:segmenter_base',
49 '../converter/converter_base.gyp:segmenter',
5050 '../converter/converter_base.gyp:segments',
5151 '../data_manager/data_manager.gyp:user_pos_manager',
5252 '../data_manager/testing/mock_data_manager.gyp:mock_data_manager',