Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
Patent2net committed Apr 4, 2023
2 parents 8b43bea + 5d025eb commit 349ee69
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 11 deletions.
16 changes: 9 additions & 7 deletions Patent2Net/P2N-Indexer.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,12 +334,12 @@ def iramCleaner (texte):
lang = detectlanguage.simple_detect(phrase)
except:
lang = ''
if len(lang) > 0:
indexLang = lang.upper() + '-' + ndf.lower()
doc['lang'] = lang.upper()
else:
indexLang = "UNK-" + ndf.lower()
doc['lang'] = "UNKNOWN"
if len(lang) > 0:
indexLang = lang.upper() + '-' + ndf.lower()
doc['lang'] = lang.upper()
else:
indexLang = "UNK-" + ndf.lower()
doc['lang'] = "UNKNOWN"
Files = [truc for truc in lstUnk if bre['label'] == truc.split('-')[1].replace('.txt', "")]
for fil in Files:
champ = ""
Expand All @@ -358,7 +358,9 @@ def iramCleaner (texte):
doc[champ] = donnes
else:
print("file ignored ", fil, champ)

else:
indexLang = "UNK-" + ndf.lower()
doc['lang'] = "UNKNOWN"
if indexLang.split('-')[0] in cpt.keys():
cpt[indexLang.split('-')[0]] += 1
else:
Expand Down
2 changes: 1 addition & 1 deletion Patent2Net/P2N-NetworksBis.py
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,7 @@ def Cleaning(texte): # this is for graphviz. Maybe an ascii converter would be o

#making the html from model
RenderTemplate(
"Graphe.html",
"OldGraphe.html",
ResultGephiPath + '/'+outputFile.replace('.gexf','JS.html'),
TitleNet=network[1:]+' Network for ' + requete,
fichierConfigJS=outputFile.replace('.gexf','') +'Conf.js',
Expand Down
2 changes: 1 addition & 1 deletion Patent2Net/P2N_Config.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def readInputFile(self):
if ".cql" in self.file.lower():
file_path = '../RequestsSets/' + self.file
return open(file_path, "r").readlines()

print(os.pardir)
return open("../requete.cql", "r").readlines()

def generatePaths(self):
Expand Down
2 changes: 1 addition & 1 deletion Patent2Net/app/dex.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ def get_directory_request_data_all(directory):
:rtype: dict
"""
request_directory = normalize_request_directory(directory)
return request_directory["data"]
return jsonify(request_directory["data"])

def delete_directory_request_data(directory, key):
"""Delete the data
Expand Down
2 changes: 1 addition & 1 deletion run-all.sh
Original file line number Diff line number Diff line change
@@ -1 +1 @@
for f in ./REQUESTS/*.cql ; do p2n run --config=$f; done
for f in ./RequestsSets/*.cql ; do p2n run --config=.$f; done
5 changes: 5 additions & 0 deletions update.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
find . -type d -name __pycache__ -exec rm -rf {} \;
pip install -r requirements.txt
pip install -r requirements-release.txt
cp dex.js dex.sav
cp dex.json dex.sav2
git stash
Expand All @@ -11,6 +14,8 @@ chmod +x update.sh
chmod +x run-all.sh
cp -f dex.sav dex.js
cp -f dex.sav2 dex.json
chown p2n:wheel dex.js
chown p2n:wheel dex.json
rm dex.sav
rm dex.sav2
cp Patent2Net/Carrot2/main.4974e0c5.chunk.js /home/p2n/carrot2/carrot2-4.2.1/dcs/web/frontend/static/js
Expand Down

0 comments on commit 349ee69

Please sign in to comment.