
Fixes:
Fix names of constants in comments.
New features:
Major:
Quiz.
Add YouTube links with pronunciation
of requested words/phrases
and links to Google Searches.
Minor:
Add remove_duplicates to users.py.
Make possible to get all user's queries in
User._get_last_queries().
Add a function of getting all words user got descriptions to
User._get_all_words_which_app_sent_descriptions_to().
Set properties of a word as Word attributes:
- self.in_db
- self.url
- self.title
- self.guidewords
- self.parts_and_descriptions
- self.transcription
Add method for class User that retrieves
parts and descriptions without "other" –
parts_and_descriptions_without_other
(although I haven't utilized it yet
since quiz feature is still in early development)
Cleanup:
Remove duplicated return statement.
Remove function i don't need anymore,
which i basically used for monitoring on scraping.
Remove deprecated function for getting
Levenshtein ration via native Python –
get_levenshtein_ratio.
Optimizations:
Make getting titles from db to memory
almost 2x faster
by using native MongoDB methods instead of Python ones.
Make getting raw word from db from class Word
cleaner
(
- less lines of code
- don't return a value to only assign it to attribute
- don't use helper method which seems redundant
)
Make getting formatted message through a class
FormattedMessage with clear methods since it's hard
to keep everything in just one Word's method
Put logic of getting data from powerthesaurus.org
to a separate class PowerThesaurus.
Maybe I also need to put third-party data providers
to a separate module...
Make white list for flood messages a constant.
Add more constant messages to config file.
Make singleton for titles in memory.
Now it's more correct to add titles from memory
since i can invoke the process of adding titles
to memory from main module i run app from
or from word_scraper module.
Getting user id better way in User.plain_info property
Changes:
Rename function
from get_suggestions_similar_from_database to
get_suggestions_from_db.
Removed asynchronous function processing
by handlers to avoid rate limiting by
third-party data providers like
powerthesaurus, shutterstock and google.