[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[silpa-discuss] Another idea for getting content from particular lines o
From: |
Vasudev Kamath |
Subject: |
[silpa-discuss] Another idea for getting content from particular lines of a file |
Date: |
Thu, 29 Apr 2010 21:58:23 +0530 |
User-agent: |
KMail/1.12.4 (Linux/2.6.33-2.slh.10-sidux-686; KDE/4.3.4; i686; ; ) |
Hi,
I'm still not having any luck on getting data from dictionary file using index
file and file seeking. So i have another approach of doing this. Here is the
idea
Module to use linecache which has function getline which can get a line from a
given file.
Pro: No head ache of offsets file seeking and other things getline with a while
loop can handle this
Con: I went through the implementation of linecache it reads entire file and
cache's it so that if you use same file again it won't go for file it gets data
from cache. Now below is the size of each dictionary file as seen from the du -
hc
2.5M dicts/bn_BD.dic
2.5M dicts/bn_IN.dic
912K dicts/en_US.dic
3.8M dicts/gu_IN.dic
300K dicts/hi_IN.dic
1.8M dicts/kn_IN.dic
5.2M dicts/ml_IN.dic
288K dicts/mr_IN.dic
24K dicts/or_IN.dic
40K dicts/pa_IN.dic
3.3M dicts/ta_IN.dic
21M total
So if we use linecache then we need minimum of 21MB for dictionaries itself.
So i'm not sure whether to continue with linecache or not. I want your opinion
Thanks and Regards
Vasudev Kamath
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [silpa-discuss] Another idea for getting content from particular lines of a file,
Vasudev Kamath <=