xiomarablanco commited on
Commit
15ffeb9
1 Parent(s): f3f3e83

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -0
app.py CHANGED
@@ -7,12 +7,15 @@ from plentas import Plentas
7
  import pandas as pd
8
  import zipfile
9
  import os
 
10
 
11
  def Main(uploadedFile, txtFileInput, orthographyPercentage, syntaxPercentage, semanticPercentage, studentsRange):
12
 
13
  error = ""
14
  modelResult = ""
15
 
 
 
16
  try:
17
  if not txtFileInput:
18
  txtFileInput = "./assets/qa.txt"
@@ -51,6 +54,13 @@ def Main(uploadedFile, txtFileInput, orthographyPercentage, syntaxPercentage, se
51
 
52
  return [error, modelResult]
53
 
 
 
 
 
 
 
 
54
  def readQATextFile(qaTextFilePath):
55
  configuration = {}
56
 
 
7
  import pandas as pd
8
  import zipfile
9
  import os
10
+ import shutil
11
 
12
  def Main(uploadedFile, txtFileInput, orthographyPercentage, syntaxPercentage, semanticPercentage, studentsRange):
13
 
14
  error = ""
15
  modelResult = ""
16
 
17
+ copySpanishDictionaries()
18
+
19
  try:
20
  if not txtFileInput:
21
  txtFileInput = "./assets/qa.txt"
 
54
 
55
  return [error, modelResult]
56
 
57
+ def copySpanishDictionaries():
58
+ try:
59
+ shutil.copy("./assets/hunspell_dictionaries/es_ES/es_ES.aff", "/home/user/.local/lib/python3.8/site-packages/hunspell/dictionaries/es_ES.aff")
60
+ shutil.copy("./assets/hunspell_dictionaries/es_ES/es_ES.dic", "/home/user/.local/lib/python3.8/site-packages/hunspell/dictionaries/es_ES.dic")
61
+ except Exception as ex:
62
+ print("Error copying dictionaries" + str(ex))
63
+
64
  def readQATextFile(qaTextFilePath):
65
  configuration = {}
66