Closed tanay1337 closed 4 years ago
@emedvedev For the Object Oriented Design part.
Could you please discuss the approach you will work for this because I have some other alternative here.
https://github.com/kivy/plyer in this project first some facade/example is made having classname and methods
ex. class TTS
and method def speak(self)
which initially set to NotImplementedError
to implement feature concerning it. And then we make different implementations concerning each platform like
tts.py
and inherits TTS class
with overriding speak
method with corresponding implementation for windows.
Similarly, linux
dir for linux and tts.py
inheriting TTS
class again with its implementation.If looks good then would like to work on it as I have already contributing to that project.
Thanks !!
@bhaveshAn sounds good to me. Here's what you can do:
tts/<engine>/main.py
(I would prefer main.py
to tts.py
for readability: if there's many files, main
is a much clearer entry point).import_module
to load the engine specified in the user config file.You're welcome to work on it. Later we'll use a similar approach for actions, too.
@emedvedev
Create a structure as you have proposed, i.e. tts/ engine /main.py
From engine do you mean espeak
/ say
Like to create tts/espeak/main.py
and tts/say/main.py
Or please elaborate if I am getting wrong.
Yes, you're getting it right. :)
@emedvedev
I have to make a PR in WIP.
Since there is huge change in codebase, so will it be good to make a new branch in upstream say py3
so that it may not affect current codebase which is on py2
What say.
Yup, a new branch sounds nice.
Could you make one?
Done, you can make PRs against the py3
branch now.
I would like to work on this
Bhavesh is running point on this one, and you're more than welcome to coordinate with him and see if you can somehow split the task.
@emedvedev
For OOD, we have made objects for tts as
config.py
tts_engine = SayTTS()
or tts_engine = EspeakTTS()
# depending on platform
Earlier, we are using WORDS
const
Example: WORDS = {'news_reader': {'groups': [['business', 'news']]}}
for business_news_reader module.
But for actions it would better to switch to NLP instead of WORDS
const as mentioned earlier.
Like,
business_news = BusinessNewsReader()
user_query = 'something asking to melissa'
if 'business' in nltk.tokenize.word_tokenize(user_query) and 'news' in nltk.tokenizeword_tokenize(user_query):
business_news.news_reader(user_query)
etc for other action modules.
What say.
Please open a PR for every separate feature, and once there's code, I'll be happy to comment on it.
NLP is definitely outside of the scope of this issue though. We are refactoring the existing code first, so let's stick to that.
For the part of Refactoring to Python 3
I tried to install deps for python3 locally from requirements.txt
print "text"
syntax is required to change to print()
Can I work on this if its still pending ?
The codebase needs to be updated to Python 3 along with the implementation of Object Oriented Design.