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

TypeError: 'float' object is not iterable #2

Closed
alznn opened this issue Jan 24, 2019 · 2 comments
Closed

TypeError: 'float' object is not iterable #2

alznn opened this issue Jan 24, 2019 · 2 comments

Comments

@alznn
Copy link

alznn commented Jan 24, 2019

if self.consonant is "w":

您好,想請教在這段 consonant 判斷式設計上的意義,

在實做上,以 wang2 為例,進入判段式後
將 vowel 取代為 u+self.vowel
並使 consonant w 為 ""

回到 getEditDistanceClose_TwoDCode 後,"" mapping 到 99999.0,

接著進入到 cDis = abs(getDistance_TwoDCode(twoDcode_consonant_a, twoDcode_consonant_b)) ,在此段中,因傳入的值為 99999.0 ,因此造成 x2 or y2 沒辦法 mapping 到 value,進而產生 TypeError: 'float' object is not iterable

因為不了解將 consonet w 取代成 "" 的意義,因此不敢隨意修改,希望可以請教設計上的相關事宜,謝謝您

@kunqian-usa
Copy link
Collaborator

DimSim/code/dimsim/dimsim/dimsim.py

Line 349 in d5b8410

if self.consonant is "w":
您好,想請教在這段 consonant 判斷式設計上的意義,

在實做上,以 wang2 為例,進入判段式後
將 vowel 取代為 u+self.vowel
並使 consonant w 為 ""

回到 getEditDistanceClose_TwoDCode 後,"" mapping 到 99999.0,

接著進入到 cDis = abs(getDistance_TwoDCode(twoDcode_consonant_a, twoDcode_consonant_b)) ,在此段中,因傳入的值為 99999.0 ,因此造成 x2 or y2 沒辦法 mapping 到 value,進而產生 TypeError: 'float' object is not iterable

因為不了解將 consonet w 取代成 "" 的意義,因此不敢隨意修改,希望可以請教設計上的相關事宜,謝謝您

Thanks for your comment, it was a bug, and now it's been fixed. We also updated the corresponding pypi project. Now, if you want to try the new version, you can do

pip install chinesesoundex-1.0

Thanks

@yunyaoli
Copy link
Contributor

Issue has been fixed.

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

3 participants