Mar-04-2018, 05:23 PM
Yes I was right but then again I was wrong CMUSphinx is a toolkit for Linux and it includes pocketsphinx
toolkit
toolkit
moving from tkinter to wxpython
|
Mar-04-2018, 05:23 PM
Yes I was right but then again I was wrong CMUSphinx is a toolkit for Linux and it includes pocketsphinx
toolkit
Mar-04-2018, 06:19 PM
Then I think it's worth exploring.
Mar-06-2018, 10:01 PM
Would yo like to comment on some of the ugly bits?
I haven't forgotten about you, but
I have been working on my own code but will get to yours later this evening, and into tomorrow if required. But I do have some questions:
Here's my idea of how chapters, mp3 file locations and (coming up) text should be handled
I am adding King James text to the json file also, and will share all the code to create as soon as done: do the following steps in order:
software: __init__.py src\ __init__.py BiblePaths.py DisplayBibleIndex.pyBiblePaths.py from pathlib import Path class BiblePaths: def __init__(self): self.homepage = Path('.') self.datapath = self.homepage / 'data' self.datapath.mkdir(exist_ok=True) self.jsonpath = self.datapath / 'json' self.jsonpath.mkdir(exist_ok=True) self.KingJamespath = self.datapath / 'KingJames' self.KingJamespath.mkdir(exist_ok=True) self.BibleIndex = self.jsonpath / 'BibleIndex.json' self.emptyinit = self.homepage / '__init__.py' self.emptyinit.touch(exist_ok=True) def onetime(): bp = BiblePaths() if __name__ == '__main__': onetime()DisplayBibleIndex.py import BiblePaths import json class DisplayBibleIndex: def __init__(self): self.npath = BiblePaths.BiblePaths() with self.npath.BibleIndex.open() as f: self.BibleIndex = json.load(f) self.show_index() def show_index(self): for volume, contents in self.BibleIndex.items(): for book, detail in contents.items(): print() for chapter, description in detail.items(): if chapter == 'mp3': print(f'mp3 file is located here: {description}') else: print(f'volume: {volume}, book: {book}, chapter: {chapter} {description}') # This is an example of how to get info on a particular Book, chapter: print(f"\nLeviticus Chapter 5: {self.BibleIndex['Old Testament']['Leviticus']['5']}") print(f"Mp3 file for Leviticus is here: {self.BibleIndex['Old Testament']['Leviticus']['mp3']}") if __name__ == '__main__': DisplayBibleIndex() Attached Files
Mar-08-2018, 11:06 AM
Okay I have followed the instructions but I get an error
f-string was introduced in python 3.6
replacement is like: # f-string version print(f'mp3 file is located here: {description}') #pre python 3.6 version print('mp3 file is located here: {}'.format(description))just change all occurrences, or better you get up to date! Had 5 or 6 power outages last night, plus 2 feet of snow. Slowed me down a bit. I need sleep, be back i several hours. But I do have some questions:
Mar-08-2018, 01:32 PM
(Mar-07-2018, 04:01 AM)Larz60+ Wrote:Well she uses the touchpad and as she cannot see the buttons need to be quite big. While the mousepointer is over a button it says either the book name or chapter ( just once). immediately the mousepointer moves off the button it stops. This prevents it starting to say multiple words as she moves the mouse about otherwise they would all start and continue until the word is finished. Quote:It's the number of books in the bible + 1 Quote:The names of the books are on the tabs so sighted people can click on them to navigate. They are too small for her to use and not all can be on screen at the same time due to the number of pages. Quote:Seems to be a completely different thing and not sure how I could write that sort of code to do what I set out to do. I am still curious about which bits of my code are ugly. I would like to see why some is and how I could improve it. I do want to advance in this.
Mar-08-2018, 05:50 PM
Quote:I am still curious about which bits of my code are ugly. I would like to see why some is and how I could improve it. I do want to advance in this.working on it, that's why the questions, and the JSON file. I just got up for a few minutes, need more sleep, than back to it. Last nights power failures slowed my down a lot.
Mar-08-2018, 06:10 PM
Not to worry, we are obviously in different time zones. We have never had more than 6" snow here. Very rare to have power cuts too.
|
|