25

Browsing the systems files of my LG P350 I discovered a strange file inside what seems to be the XT9 files: there's a txt file called heads_of_state.txt, which contents are the following:

Hamid
Karzai
Bamir
Topi    
Sali
Berisha
Abdelaziz
Bouteflika
Ahmed
Ouyahia
Andorra
Joan
Enric 
Vives 
Sicília
Nemesi 
Marquès 
Oste
Nicolas 
Sarkozy
Christian 
Frémont
Albert 
Pintat
Jaume 
Bartumeu
José 
Eduardo 
dos 
Santos 
Paulo 
...

The list continues and I can spot a few presidents names. It's located in system/usr/xt9/databases/mdb/

What does this means?? Why the file is there? What it is porpuose?

For the curious, here's the full list: http://pastebin.com/V8hHYZmz

(I'm using the V10F firwmare, rooted with Gingerbread)

Andres
  • 379
  • 1
  • 3
  • 9
  • 3
    It's probably for the auto-complete/spellcheck dictionary so that political leaders can be added and removed more easily due to their often transient nature (but I can't prove that, so comment instead of answer). – eldarerathis Apr 13 '12 at 16:05
  • I tried to type the names in a SMS with XT9 enabled and it didn't recognized the words or tried to correct them. Paranoia is attacking me :F – Andres Apr 13 '12 at 16:09
  • Interesting that this exists! I would agree with @eldarerathis it is most likely used for AC or spellcheck – Bryan Denny Apr 13 '12 at 16:31
  • 1
    Why would some head of state be removed from dictionary, even if (s)he is no longer in office? Besides this list is little outdated, some of those names are not in office anymore. – Tschareck Apr 13 '12 at 17:56
  • 2
    I insist, this words aren't used in the XT9. – Andres Apr 13 '12 at 18:10
  • @Tschareck: It's kind of moot at this point, but you don't see the value in being able to add new political leaders on the fly without having to replace the entire dictionary file? You certainly don't have to remove people who are no longer in office, and it seems they don't by your own observation, but even for just adding new names it would provide a lot of benefits. – eldarerathis Apr 13 '12 at 18:20
  • 1
    @eldarerathis I think the real question here is why we need a dictionary for the name of the presidents. And why it's bundled to the stock firmware. – Andres Apr 13 '12 at 19:02
  • Is this a stock ROM? – Flow Apr 13 '12 at 19:16
  • If it was a dictionary, then maybe it would make a point to have separate file, because names are common to all languages. But as @Andres (and me too) pointed out, XT9 doesn't use them. – Tschareck Apr 13 '12 at 19:17
  • @Flow Yup, version V10F: http://csmg.lgmobile.com:9002/swdata/WEBSW/LGP350/ACISSV/V10F_00/V10F_00.kdz. Also i found it in a LG Keyboard apk of another phone (not remember which one, because it was only the apk file) – Andres Apr 13 '12 at 20:10
  • @Tschareck: Your previous comment doesn't make any statements regarding XT9 or whether or not the file is used by it (or even a dictionary), so I have no idea what point you're even trying to make now. That seems like a complete non sequitur. Andres: Are there any other files in that directory or is this the only one? Does it look like it's been accessed at all recently? (ls -l should show you) – eldarerathis Apr 13 '12 at 20:47
  • 2
    Strange. I'll be this is left over from testing of some kind. They probably just imported a random list to test some function. – Matt Apr 13 '12 at 22:21
  • @eldarerathis Yes, there are more files in the folder:

    DE.txt EN.txt ES.txt FR.txt heads_of_state.txt IT.txt mdb.py mdb.txt

    The files with two charaters in the name are 2 bytes long (2 hex numbers)

    Python file contents are: #!/usr/bin/env python3.0

    import codecs

    filein = 'heads_of_state.txt' fileout = 'mdb.txt'

    setHeads = set() for line in codecs.open(filein, 'r', 'utf-8'): setHeads.add(line.strip()) liHeads = sorted(setHeads, key=lambda a: (len(a), a)) liHeads = filter(lambda a: len(a) > 4, liHeads) codecs.open(fileout, 'w', 'utf-8').write("\n".join(liHeads))

    – Andres Apr 14 '12 at 03:01
  • Ooops, no formating in comments! Here are the contents of mdb.py: http://pastebin.com/n3jUrdEA Contents of mdb.txt: http://pastebin.com/WeVq2pHF – Andres Apr 14 '12 at 03:05
  • @eldarerathis ls -l result is: -rw-r--r-- root root 6265 2011-04-18 10:22 heads_of_state.txt. All the other files show the same date. – Andres Apr 14 '12 at 03:08

3 Answers3

1

I found a related github repo but don't know if its official or from some ROM developer. From the source the file heads_of_state.txt is listed under IME but has been removed in the latest commit (the only other commit). The commit message is "Deleted uneeded LG's Calibration apk". I can't conclude anything from this but maybe this will be helpful.

roxan
  • 5,457
  • 5
  • 31
  • 42
1

Just found this strange python script that is included in the XT9. Note that it uses the 'heads_of_state.txt' file as input for something. Seems like a sorting script or something.

segfaultd
  • 121
  • 1
0

i searched the internet for it, and the file seems is for developers testing purpose, this file can be found in other platforms either. i found it in: Python Android PHP


seems like foo bar case

  • Please provide a link, I didn't find any references to such a list being used for testing. Though it indeed does look a lot like foo bar case. – Ilari Kajaste Apr 19 '12 at 06:52