mno2 / cedarwood Goto Github PK
View Code? Open in Web Editor NEWEfficiently-updatable double-array trie in Rust (ported from cedar)
License: BSD 2-Clause "Simplified" License
Efficiently-updatable double-array trie in Rust (ported from cedar)
License: BSD 2-Clause "Simplified" License
Hello. I was performing some stress tests on my backport and think that erase_ should test for CEDAR_NO_VALUE before actually deferring the call erase__.
The following panics with index out of bounds:
fn broken_erase() {
let mut c = Cedar::new();
c.update("aa", 0);
c.update("ab", 1);
c.erase("a"); // should not have any side effect
c.erase("aa");
c.erase("ab"); // panics
}
Perhaps
fn erase_(&mut self, key: &[u8]) {
let mut from = 0;
if let Some(value) = self.find(&key, &mut from) {
if value != CEDAR_NO_VALUE {
self.erase__(from);
}
}
}
will do the trick?
It only happens when reduced-trie
is disabled.
一亮 3 a
一亲芳泽 3 nr
一人之下 26 i
一人之交 3 i
一亿七千万 2 m
一亿三千万 2 m
一亿三千万年 2 m
一亿三千余万两 2 m
一亿三千多万年 2 m
一亿两千万 2 m
一亿二千万 2 m
一亿五千万 5 m
一亿人 3 l
一亿人次 2 m
一亿八千八百余万元 2 m
一亿六千多万元 2 m
一亿分 2 m
一亿四千五百万日元 2 m
一亿多 23 m
一亿多年 4 m
一亿多美元 2 m
一亿年 2 m
一亿担 2 m
一亿次 18 m
一亿零一百万两 2 m
一亿零五百万 2 m
一介 3 n
一介不取 3 l
一介不苟 3 i
一介之善 3 l
一介之士 3 i
一介之才 3 l
一介书生 20 n
一介武夫 3 nr
一仍其旧 3 nr
一仍旧贯 3 nr
一代 2101 m
一代人 66 n
一代代 93 m
一代宗师 3 i
一代宗臣 3 i
一代文宗 3 nz
一代新人 3 nz
一代楷模 3 nr
一代英豪 3 l
一代谈宗 3 nz
一代豪杰 3 i
一代风流 3 i
一代鼎臣 3 i
一以当十 3 i
一以当百 3 i
一以贯之 44 i
一件 6216 m
一件件 2 l
一任 188 m
一份 3677 m
一伍 3 n
一休哥 3 n
一伙 491 m
一伙人 3 r
一伙儿 3 r
一会 3178 m
一会一节 5 m
一会儿 3200 m
一会儿双行 2 m
一会儿回 2 m
一会儿天 3 m
一会儿头 2 m
一会儿开 8 m
一会儿张 2 m
一传 72 b
一传十 3 i
Using either of the dataset
jieba-rs
and benchmark it with weichengA declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.