Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev 1002 增加 leveldb key-value db, 供librime-lua 調用 大資料 ,可 減少載入時間及內存 #177

Merged
merged 28 commits into from
Jul 13, 2022

Conversation

shewer
Copy link
Contributor

@shewer shewer commented Jul 13, 2022

增加 leveldb key-value db
供librime-lua 調用 大資料 ,可 減少載入時間及內存

shewer added 27 commits March 30, 2021 20:03
Signed-off-by: shewer <[email protected]>
Signed-off-by: shewer <[email protected]>
Signed-off-by: shewer <[email protected]>
Signed-off-by: shewer <[email protected]>
Signed-off-by: shewer <[email protected]>
Signed-off-by: shewer <[email protected]>
Signed-off-by: shewer <[email protected]>
* add  EngineReg select_schema()  env.engine:select( string schema_id ) .next

Signed-off-by: shewer <[email protected]>

* add engine:apply_schema( Schema &)   Schema( const string &)

Signed-off-by: shewer <[email protected]>
Signed-off-by: Shewer Lu <[email protected]>
@shewer shewer changed the title Dev 1002 Dev 1002 增加 leveldb key-value db, 供librime-lua 調用 大資料 ,可 減少載入及內存 Jul 13, 2022
}
string fetch(an<T> t, const string& key){
string res;
return ( t->Fetch(key,&res) )? res : nullptr ;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里试过吗?nullptr 应该会崩掉

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

optional<string> 看起来合理一些,参考 ConfigValueReg::get_bool()

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

嗯 這是個問題,本想 查詢不到 return nil
key 查不到 nell or 空字串
nil 就要用 raw_fetch return nil
建議用 nli ro "" ??

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

optional<string> return {} 就是会翻译成 lua 的 nil

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok 改好了

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

終於可以用 leveldb 調用 ecdict 英打+美漢字典

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ReverseDictionaryRegProjectionReg 有几个类似的地方可以也统一改一下

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ProjectionReg 建議和 librime 相同機制
pattern 異常 return 原碼
ReverseDB 反查不到 return ""

@shewer shewer changed the title Dev 1002 增加 leveldb key-value db, 供librime-lua 調用 大資料 ,可 減少載入及內存 Dev 1002 增加 leveldb key-value db, 供librime-lua 調用 大資料 ,可 減少載入時間及內存 Jul 13, 2022
@hchunhui hchunhui merged commit a28279c into hchunhui:master Jul 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants