Developing a Lightweight Morphological Analyzer for Mobile: Achieving 200KB with C++ and LOUDS
Key point
A case study of developing a morphological analyzer that reduced the final library size to approximately 200KB by using C++ and the LOUDS data structure to overcome strict capacity limits in mobile environments, and improved analysis speed by approximately 17% by optimizing the select0 operation.
Details
While developing a lightweight morphological analyzer for mobile clients, we chose C++ because Rust's default binary size (2–3MB) was burdensome. C++ facilitates linking with existing libraries, allowing us to minimize the final library size to approximately 200KB. For dictionary data compression, we applied the LOUDS (Level-Order Unary Degree Sequence) data structure, which uses bit sequences instead of pointers, compressing approximately 760,000 nodes to 9.4MB. Additionally, by optimizing the select0 operation, which was the bottleneck in dictionary search, using 64-bit chunks and cumulative count arrays, we reduced short sentence processing time from 0.023ms to 0.019ms and improved overall analysis time by approximately 17%.
This summary was generated automatically by AI. Check the original for the author's claims and context. Copyright belongs to the original author.
Our guide explains how the AI works. Report summary errors, attribution issues, or removal requests via Contact.