Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FastEfficiency vector failure #2

Open
dim-geo opened this issue Aug 11, 2015 · 0 comments
Open

FastEfficiency vector failure #2

dim-geo opened this issue Aug 11, 2015 · 0 comments

Comments

@dim-geo
Copy link

dim-geo commented Aug 11, 2015

Hi, I cannot use FastEfficiency. Something is not initialized properly.
I can provide corpus if needed...

Also, what's the point of exp_par? What is a sane value?
Thanks for this library! I try to create a t9 optimized keyboard...

ipython3
Python 3.4.1 (default, Oct 29 2014, 01:11:58) 
Type "copyright", "credits" or "license" for more information.

IPython 2.2.0 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.

In [1]: %pylab
Using matplotlib backend: Qt4Agg
Populating the interactive namespace from numpy and matplotlib

In [2]: from dodona import core, keyboards, wordlists

In [3]: from copy import deepcopy

In [4]: import time

In [5]: import numpy as np

In [6]: from multiprocessing import Pool

In [7]: dictionary = open('greek_corpus', 'r')

In [8]: 

In [8]: greek=                  'αάβγδεέζηήθιίϊΐκλμνξοόπρσςτυύΰϋφχψωώ'

In [9]: english_mapping_for_t9= 'aabcdeefhhgiiiikljnmooprsqtuuuuyxzww'

In [10]: wordlist = core.WordList()

In [11]: 

In [11]: 

In [11]: trans_table = str.maketrans(greek, english_mapping_for_t9)

In [12]: for line in dictionary:
   ....:       word,frequency=line.split()
   ....:       #print(word)
   ....:       wordlist.AddWord(word.translate(trans_table),int(frequency)-1943)
   ....:     #print(wordlist.WordListDict())
   ....:     

In [13]: t9_keyboard = keyboards.MakeT9Keyboard()

In [14]: t9_model = core.SimpleGaussianModel()

In [15]: t9_model.SetScale(0)

In [16]: print(1- core.FastEfficiency(t9_keyboard, t9_model, wordlist,1.0).Fitness())
---------------------------------------------------------------------------
IndexError                                Traceback (most recent call last)
<ipython-input-16-53a073886fe7> in <module>()
----> 1 print(1- core.FastEfficiency(t9_keyboard, t9_model, wordlist,1.0).Fitness())

IndexError: vector::_M_range_check

In [17]: 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant