Move storage/louds/key_expansion_table{.h, _test.cc} files to dictionary/system
Key expansion table is no longer associated with louds trie but system dictionary. So it should be located under dictionary/system.
This is just a code refactoring, no user-visible behavior change is intended.
BUG=none
TEST=unittest
git-svn-id: https://mozc.googlecode.com/svn/trunk@527 a6090854-d499-a067-5803-1114d4e51264
diff --git a/src/storage/louds/key_expansion_table.h b/src/dictionary/system/key_expansion_table.h
similarity index 93%
rename from src/storage/louds/key_expansion_table.h
rename to src/dictionary/system/key_expansion_table.h
index 6bcb81d..8930bd1 100644
--- a/src/storage/louds/key_expansion_table.h
+++ b/src/dictionary/system/key_expansion_table.h
@@ -27,8 +27,8 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#ifndef MOZC_STORAGE_LOUDS_KEY_EXPANSION_TABLE_H_
-#define MOZC_STORAGE_LOUDS_KEY_EXPANSION_TABLE_H_
+#ifndef MOZC_DICTIONARY_SYSTEM_KEY_EXPANSION_TABLE_H_
+#define MOZC_DICTIONARY_SYSTEM_KEY_EXPANSION_TABLE_H_
#include <cstring>
#include <string>
@@ -36,8 +36,7 @@
#include "base/port.h"
namespace mozc {
-namespace storage {
-namespace louds {
+namespace dictionary {
// Very thin wrapper class to check the edge annotated character is hit the
// expanded key or not.
@@ -103,8 +102,7 @@
DISALLOW_COPY_AND_ASSIGN(KeyExpansionTable);
};
-} // namespace louds
-} // namespace storage
+} // namespace dictionary
} // namespace mozc
-#endif // MOZC_STORAGE_LOUDS_KEY_EXPANSION_TABLE_H_
+#endif // MOZC_DICTIONARY_SYSTEM_KEY_EXPANSION_TABLE_H_
diff --git a/src/storage/louds/key_expansion_table_test.cc b/src/dictionary/system/key_expansion_table_test.cc
similarity index 92%
rename from src/storage/louds/key_expansion_table_test.cc
rename to src/dictionary/system/key_expansion_table_test.cc
index e296efa..85f8823 100644
--- a/src/storage/louds/key_expansion_table_test.cc
+++ b/src/dictionary/system/key_expansion_table_test.cc
@@ -27,18 +27,15 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#include "storage/louds/key_expansion_table.h"
+#include "dictionary/system/key_expansion_table.h"
#include "testing/base/public/gunit.h"
+namespace mozc {
+namespace dictionary {
namespace {
-using ::mozc::storage::louds::KeyExpansionTable;
-
-class KeyExpansionTableTest : public ::testing::Test {
-};
-
-TEST_F(KeyExpansionTableTest, Test) {
+TEST(KeyExpansionTableTest, Test) {
KeyExpansionTable table;
table.Add('b', "d");
@@ -64,3 +61,5 @@
}
} // namespace
+} // namespace dictionary
+} // namespace mozc
diff --git a/src/dictionary/system/system_dictionary.cc b/src/dictionary/system/system_dictionary.cc
index 54ae426..6c06f2d 100644
--- a/src/dictionary/system/system_dictionary.cc
+++ b/src/dictionary/system/system_dictionary.cc
@@ -72,8 +72,6 @@
namespace dictionary {
using mozc::storage::louds::BitVectorBasedArray;
-using mozc::storage::louds::ExpandedKey;
-using mozc::storage::louds::KeyExpansionTable;
using mozc::storage::louds::LoudsTrie;
namespace {
diff --git a/src/dictionary/system/system_dictionary.gyp b/src/dictionary/system/system_dictionary.gyp
index e754169..0979c88 100644
--- a/src/dictionary/system/system_dictionary.gyp
+++ b/src/dictionary/system/system_dictionary.gyp
@@ -41,6 +41,14 @@
],
},
{
+ 'target_name': 'key_expansion_table',
+ 'type': 'none',
+ 'toolsets': ['target', 'host'],
+ 'sources': [
+ 'key_expansion_table.h',
+ ],
+ },
+ {
'target_name': 'system_dictionary',
'type': 'static_library',
'sources': [
@@ -52,6 +60,7 @@
'../../storage/louds/louds.gyp:louds_trie',
'../dictionary_base.gyp:text_dictionary_loader',
'../file/dictionary_file.gyp:dictionary_file',
+ 'key_expansion_table',
'system_dictionary_codec',
],
},
diff --git a/src/dictionary/system/system_dictionary.h b/src/dictionary/system/system_dictionary.h
index 54de3ee..7e6c097 100644
--- a/src/dictionary/system/system_dictionary.h
+++ b/src/dictionary/system/system_dictionary.h
@@ -42,9 +42,9 @@
#include "base/string_piece.h"
#include "dictionary/dictionary_interface.h"
#include "dictionary/system/codec_interface.h"
+#include "dictionary/system/key_expansion_table.h"
#include "dictionary/system/words_info.h"
#include "storage/louds/bit_vector_based_array.h"
-#include "storage/louds/key_expansion_table.h"
#include "storage/louds/louds_trie.h"
// for FRIEND_TEST
#include "testing/base/public/gunit_prod.h"
@@ -220,7 +220,7 @@
Callback::ResultType LookupPrefixWithKeyExpansionImpl(
const char *key,
StringPiece encoded_key,
- const storage::louds::KeyExpansionTable &table,
+ const KeyExpansionTable &table,
Callback *callback,
storage::louds::LoudsTrie::Node node,
StringPiece::size_type key_pos,
@@ -241,7 +241,7 @@
void CollectPredictiveNodesInBfsOrder(
StringPiece encoded_key,
- const storage::louds::KeyExpansionTable &table,
+ const KeyExpansionTable &table,
size_t limit,
vector<PredictiveLookupSearchState> *result) const;
@@ -254,7 +254,7 @@
const uint32 *frequent_pos_;
const SystemDictionaryCodecInterface *codec_;
- storage::louds::KeyExpansionTable hiragana_expansion_table_;
+ KeyExpansionTable hiragana_expansion_table_;
DISALLOW_COPY_AND_ASSIGN(SystemDictionary);
};
diff --git a/src/dictionary/system/system_dictionary_test.cc b/src/dictionary/system/system_dictionary_test.cc
index fad2309..983b803 100644
--- a/src/dictionary/system/system_dictionary_test.cc
+++ b/src/dictionary/system/system_dictionary_test.cc
@@ -90,8 +90,6 @@
} // namespace
-using mozc::storage::louds::KeyExpansionTable;
-
class SystemDictionaryTest : public testing::Test {
protected:
SystemDictionaryTest()
diff --git a/src/dictionary/system/system_dictionary_test.gyp b/src/dictionary/system/system_dictionary_test.gyp
index 5066fd3..fd615d2 100644
--- a/src/dictionary/system/system_dictionary_test.gyp
+++ b/src/dictionary/system/system_dictionary_test.gyp
@@ -44,6 +44,20 @@
},
},
{
+ 'target_name': 'key_expansion_table_test',
+ 'type': 'executable',
+ 'sources': [
+ 'key_expansion_table_test.cc',
+ ],
+ 'dependencies': [
+ '../../testing/testing.gyp:gtest_main',
+ 'system_dictionary.gyp:key_expansion_table',
+ ],
+ 'variables': {
+ 'test_size': 'small',
+ },
+ },
+ {
'target_name': 'system_dictionary_test',
'type': 'executable',
'sources': [
@@ -102,6 +116,7 @@
'target_name': 'system_dictionary_all_test',
'type': 'none',
'dependencies': [
+ 'key_expansion_table_test',
'system_dictionary_builder_test',
'system_dictionary_codec_test',
'system_dictionary_test',
diff --git a/src/mozc_version_template.txt b/src/mozc_version_template.txt
index 6e9fe1b..5315e7e 100644
--- a/src/mozc_version_template.txt
+++ b/src/mozc_version_template.txt
@@ -1,6 +1,6 @@
MAJOR=2
MINOR=16
-BUILD=2043
+BUILD=2044
REVISION=102
# NACL_DICTIONARY_VERSION is the target version of the system dictionary to be
# downloaded by NaCl Mozc.
diff --git a/src/storage/louds/louds.gyp b/src/storage/louds/louds.gyp
index 1e65f75..cb323ae 100644
--- a/src/storage/louds/louds.gyp
+++ b/src/storage/louds/louds.gyp
@@ -39,14 +39,6 @@
],
},
{
- 'target_name': 'key_expansion_table',
- 'type': 'none',
- 'toolsets': ['target', 'host'],
- 'sources': [
- 'key_expansion_table.h',
- ],
- },
- {
'target_name': 'louds_trie',
'type': 'static_library',
'toolsets': ['target', 'host'],
@@ -55,7 +47,6 @@
],
'dependencies': [
'../../base/base.gyp:base',
- 'key_expansion_table',
'louds',
'simple_succinct_bit_vector_index',
],
diff --git a/src/storage/louds/louds_test.gyp b/src/storage/louds/louds_test.gyp
index 8aec5eb..d140411 100644
--- a/src/storage/louds/louds_test.gyp
+++ b/src/storage/louds/louds_test.gyp
@@ -30,20 +30,6 @@
{
'targets': [
{
- 'target_name': 'key_expansion_table_test',
- 'type': 'executable',
- 'sources': [
- 'key_expansion_table_test.cc',
- ],
- 'dependencies': [
- '../../testing/testing.gyp:gtest_main',
- 'louds.gyp:key_expansion_table',
- ],
- 'variables': {
- 'test_size': 'small',
- },
- },
- {
'target_name': 'louds_trie_test',
'type': 'executable',
'sources': [
@@ -108,7 +94,6 @@
'dependencies': [
'bit_stream_test',
'bit_vector_based_array_test',
- 'key_expansion_table_test',
'louds_trie_test',
'simple_succinct_bit_vector_index_test',
],
diff --git a/src/storage/louds/louds_trie_test.cc b/src/storage/louds/louds_trie_test.cc
index 2427faf..2416aa0 100644
--- a/src/storage/louds/louds_trie_test.cc
+++ b/src/storage/louds/louds_trie_test.cc
@@ -29,20 +29,12 @@
#include "storage/louds/louds_trie.h"
-#include <limits>
-#include <string>
#include <vector>
#include "base/port.h"
-#include "storage/louds/key_expansion_table.h"
#include "storage/louds/louds_trie_builder.h"
#include "testing/base/public/gunit.h"
-// undef max macro if defined.
-#ifdef max
-#undef max
-#endif // max
-
namespace mozc {
namespace storage {
namespace louds {