kwabs22 commited on
Commit
8703cf4
1 Parent(s): d7a29b8

Bug isolation attempt

Browse files
Files changed (1) hide show
  1. app.py +18 -18
app.py CHANGED
@@ -88,7 +88,7 @@ nlp_en_syllable.add_pipe("syllables", after="tagger") #https://spacy.io/universe
88
  langdropdown_choices = [f"{code}: {name}" for code, name in LANGUAGES.items()]
89
 
90
  nlp = spacy.load('en_core_web_sm')
91
- translator = Translator()
92
 
93
  def Sentencechunker(sentence):
94
  Sentchunks = sentence.split(" ")
@@ -164,23 +164,23 @@ langdest = gr.Dropdown(choices=langdropdown_choices, label="Choose Language", va
164
 
165
  ChunkModeDrop = gr.Dropdown(choices=["Chunks", "Reverse", "Three Word Chunks", "Spelling Chunks"], label="Choose Chunk Type", value="Chunks")
166
 
167
- def FrontRevSentChunk (Chunkmode, Translate, Text, langdest):
168
- FinalOutput = ""
169
- TransFinalOutput = ""
170
- if Chunkmode=="Chunks":
171
- FinalOutput += Sentencechunker(Text)
172
- if Chunkmode=="Reverse":
173
- FinalOutput += ReverseSentenceChunker(Text)
174
- if Chunkmode=="Three Word Chunks":
175
- FinalOutput += three_words_chunk(Text)
176
- if Chunkmode=="Spelling Chunks":
177
- FinalOutput += BatchWordChunk(Text)
178
 
179
- if Translate:
180
- TransFinalOutput = FinalOutput
181
- translated = translator.translate(TransFinalOutput, dest=langdest[:2])
182
- FinalOutput += "\n" + translated.text
183
- return FinalOutput
184
 
185
  # Define a function to filter out non-verb, noun, or adjective words
186
  def filter_words(words):
@@ -2412,7 +2412,7 @@ Each type of knowing involves different cognitive processes and levels of unders
2412
  """)
2413
 
2414
  with gr.Tab("Transition is the end goal (SOV, SVO, VSO)"):
2415
- gr.Interface(fn=FrontRevSentChunk, inputs=[ChunkModeDrop, "checkbox", "text", langdest], outputs="text", description="Chunks creator")
2416
  with gr.Row():
2417
  with gr.Column():
2418
  gr.Interface(fn=AutoSyllablePractice, inputs="text", outputs="text", description="One Word At A Time | Audio Spelling Practice Using vowels as the seperator")
 
88
  langdropdown_choices = [f"{code}: {name}" for code, name in LANGUAGES.items()]
89
 
90
  nlp = spacy.load('en_core_web_sm')
91
+ #translator = Translator()
92
 
93
  def Sentencechunker(sentence):
94
  Sentchunks = sentence.split(" ")
 
164
 
165
  ChunkModeDrop = gr.Dropdown(choices=["Chunks", "Reverse", "Three Word Chunks", "Spelling Chunks"], label="Choose Chunk Type", value="Chunks")
166
 
167
+ # def FrontRevSentChunk (Chunkmode, Translate, Text, langdest):
168
+ # FinalOutput = ""
169
+ # TransFinalOutput = ""
170
+ # if Chunkmode=="Chunks":
171
+ # FinalOutput += Sentencechunker(Text)
172
+ # if Chunkmode=="Reverse":
173
+ # FinalOutput += ReverseSentenceChunker(Text)
174
+ # if Chunkmode=="Three Word Chunks":
175
+ # FinalOutput += three_words_chunk(Text)
176
+ # if Chunkmode=="Spelling Chunks":
177
+ # FinalOutput += BatchWordChunk(Text)
178
 
179
+ # if Translate:
180
+ # TransFinalOutput = FinalOutput
181
+ # translated = translator.translate(TransFinalOutput, dest=langdest[:2])
182
+ # FinalOutput += "\n" + translated.text
183
+ # return FinalOutput
184
 
185
  # Define a function to filter out non-verb, noun, or adjective words
186
  def filter_words(words):
 
2412
  """)
2413
 
2414
  with gr.Tab("Transition is the end goal (SOV, SVO, VSO)"):
2415
+ # gr.Interface(fn=FrontRevSentChunk, inputs=[ChunkModeDrop, "checkbox", "text", langdest], outputs="text", description="Chunks creator")
2416
  with gr.Row():
2417
  with gr.Column():
2418
  gr.Interface(fn=AutoSyllablePractice, inputs="text", outputs="text", description="One Word At A Time | Audio Spelling Practice Using vowels as the seperator")