Skip to content

Feature/pronunciation#10

Open
wyj1026 wants to merge 5 commits intoFlowerowl:masterfrom
wyj1026:feature/pronunciation
Open

Feature/pronunciation#10
wyj1026 wants to merge 5 commits intoFlowerowl:masterfrom
wyj1026:feature/pronunciation

Conversation

@wyj1026
Copy link
Copy Markdown

@wyj1026 wyj1026 commented Oct 7, 2017

This is a new feature which allows user to get the pronunciation of the word they search.
Usage: ici -p word

@wyj1026
Copy link
Copy Markdown
Author

wyj1026 commented Oct 7, 2017

But the code is not clean enough, it might be a good idea to write a new method like manage to deal with the tags to show and tags to pronounce. And then the show method
and pronounce method just need to do simple things.

ici/ici.py Outdated
def pronounce(node):
pros2play = []
get_all_pros(node, pros2play)
subprocess.Popen("mpg123 -q "+" ".join(pros2play), shell=True)
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mpg123 can play url,mpg123 -@ http://...mp3

ici/ici.py Outdated

def get_all_pros(node, pros2play):
if not node.hasChildNodes():
if node.nodeType == node.TEXT_NODE and node.data != '\n':
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can just use regex to parse .mp3 urls

@wyj1026
Copy link
Copy Markdown
Author

wyj1026 commented Oct 9, 2017

Thanks for your suggestions, anything more that I can improve?

Repository owner deleted a comment from jimga150 Mar 19, 2024
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

Successfully merging this pull request may close these issues.

2 participants