search in large text file (java) -


so, have dictionary-file 70,000 lines ordered alphabetically. each line separate word translation. recommend best practice searching in such file? i'm thinking indexation of file may there're better ways.

first of all, memory-map using java nio's memory-mapped file support. second, pre-process find offsets @ new entry starts. finally, write binary-search code find entry. think amount lightweight , memory-efficient solution.

lucene employs skip-lists: can additionally cache in-memory every 16th (or so) entry , use in first phase of binary search. you'll have go actual file 0 in on exact entry.


Comments

Popular posts from this blog

javascript - backbone.js Collection.add() doesn't `construct` (`initialize`) an object -

php - Get uncommon values from two or more arrays -

Adding duplicate array rows in Php -