summaryrefslogtreecommitdiffstats
path: root/src/storage
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2017-02-07 13:38:09 +0800
committerPeng Wu <alexepico@gmail.com>2017-02-07 13:38:09 +0800
commit55d7fed35b663fa4acadc42e24a2175c228f7c37 (patch)
tree23502de338082c99c8e684f34ad46a8c58f90c8a /src/storage
parent8df49857ef632ab03c290df8ee6abe9f436d1d3c (diff)
downloadlibpinyin-55d7fed35b663fa4acadc42e24a2175c228f7c37.tar.gz
libpinyin-55d7fed35b663fa4acadc42e24a2175c228f7c37.tar.xz
libpinyin-55d7fed35b663fa4acadc42e24a2175c228f7c37.zip
fixes compile again
Diffstat (limited to 'src/storage')
-rw-r--r--src/storage/phonetic_key_matrix.cpp12
-rw-r--r--src/storage/phonetic_key_matrix.h18
2 files changed, 15 insertions, 15 deletions
diff --git a/src/storage/phonetic_key_matrix.cpp b/src/storage/phonetic_key_matrix.cpp
index 543da5b..c6f07f6 100644
--- a/src/storage/phonetic_key_matrix.cpp
+++ b/src/storage/phonetic_key_matrix.cpp
@@ -348,8 +348,8 @@ bool dump_matrix(PhoneticKeyMatrix * matrix) {
}
int search_matrix_recur(GArray * cached_keys,
- FacadeChewingTable2 * table,
- PhoneticKeyMatrix * matrix,
+ const FacadeChewingTable2 * table,
+ const PhoneticKeyMatrix * matrix,
size_t start, size_t end,
PhraseIndexRanges ranges,
size_t & longest) {
@@ -407,8 +407,8 @@ int search_matrix_recur(GArray * cached_keys,
return result;
}
-int search_matrix(FacadeChewingTable2 * table,
- PhoneticKeyMatrix * matrix,
+int search_matrix(const FacadeChewingTable2 * table,
+ const PhoneticKeyMatrix * matrix,
size_t start, size_t end,
PhraseIndexRanges ranges) {
assert(end < matrix->size());
@@ -437,7 +437,7 @@ int search_matrix(FacadeChewingTable2 * table,
return result;
}
-gfloat compute_pronunciation_possibility_recur(PhoneticKeyMatrix * matrix,
+gfloat compute_pronunciation_possibility_recur(const PhoneticKeyMatrix * matrix,
size_t start, size_t end,
GArray * cached_keys,
PhraseItem & item){
@@ -490,7 +490,7 @@ gfloat compute_pronunciation_possibility_recur(PhoneticKeyMatrix * matrix,
return result;
}
-gfloat compute_pronunciation_possibility(PhoneticKeyMatrix * matrix,
+gfloat compute_pronunciation_possibility(const PhoneticKeyMatrix * matrix,
size_t start, size_t end,
GArray * cached_keys,
PhraseItem & item){
diff --git a/src/storage/phonetic_key_matrix.h b/src/storage/phonetic_key_matrix.h
index 62edf73..968b969 100644
--- a/src/storage/phonetic_key_matrix.h
+++ b/src/storage/phonetic_key_matrix.h
@@ -77,7 +77,7 @@ public:
}
/* Array of Item. */
- bool get_items(size_t index, GArray * items) {
+ bool get_items(size_t index, GArray * items) const {
g_array_set_size(items, 0);
if (index >= m_table_content->len)
@@ -99,7 +99,7 @@ public:
return true;
}
- size_t get_column_size(size_t index) {
+ size_t get_column_size(size_t index) const {
assert(index < m_table_content->len);
GArray * column = (GArray *)
@@ -107,7 +107,7 @@ public:
return column->len;
}
- bool get_item(size_t index, size_t row, Item & item) {
+ bool get_item(size_t index, size_t row, Item & item) const {
assert(index < m_table_content->len);
GArray * column = (GArray *)
@@ -141,7 +141,7 @@ public:
}
/* Array of keys and key rests. */
- bool get_items(size_t index, GArray * keys, GArray * key_rests) {
+ bool get_items(size_t index, GArray * keys, GArray * key_rests) const {
bool result = m_keys.get_items(index, keys) &&
m_key_rests.get_items(index, key_rests);
@@ -155,14 +155,14 @@ public:
m_key_rests.append(index, key_rest);
}
- size_t get_column_size(size_t index) {
+ size_t get_column_size(size_t index) const {
const size_t size = m_keys.get_column_size(index);
assert(size == m_key_rests.get_column_size(index));
return size;
}
bool get_item(size_t index, size_t row,
- ChewingKey & key, ChewingKeyRest & key_rest) {
+ ChewingKey & key, ChewingKeyRest & key_rest) const {
return m_keys.get_item(index, row, key) &&
m_key_rests.get_item(index, row, key_rest);
}
@@ -207,12 +207,12 @@ bool fuzzy_syllable_step(pinyin_option_t options,
bool dump_matrix(PhoneticKeyMatrix * matrix);
-int search_matrix(FacadeChewingTable2 * table,
- PhoneticKeyMatrix * matrix,
+int search_matrix(const FacadeChewingTable2 * table,
+ const PhoneticKeyMatrix * matrix,
size_t start, size_t end,
PhraseIndexRanges ranges);
-gfloat compute_pronunciation_possibility(PhoneticKeyMatrix * matrix,
+gfloat compute_pronunciation_possibility(const PhoneticKeyMatrix * matrix,
size_t start, size_t end,
GArray * cached_keys,
PhraseItem & item);