Commit 41a5c54f authored by Elias's avatar Elias

query preparation

parent b3002fd2
...@@ -80,6 +80,16 @@ python3 hierarchiqueAvecDerniereDistance.py \ ...@@ -80,6 +80,16 @@ python3 hierarchiqueAvecDerniereDistance.py \
--output_name_complete dendro_complete.png --output_name_complete dendro_complete.png
``` ```
# Matching process
## 1. Query preparation
### • This script assumes you have a .csv file with a column corresponding to the words you want to cut from the turns of speech
**csv_en_mots.py :** Output example : "word1" "word2"
```bash
python3 csv_en_mots.py mots.csv
```
# Tools # Tools
### • Counting the number of segments ### • Counting the number of segments
......
import csv
import sys
if len(sys.argv) != 2:
print("Usage: python3 csv_en_mots.py mots.csv")
sys.exit(1)
fichier_csv = sys.argv[1]
mots = []
with open(fichier_csv, newline='', encoding="utf-8") as f:
lecteur = csv.reader(f)
for ligne in lecteur:
if ligne: # éviter les lignes vides
mot = ligne[0].strip()
if mot:
mots.append(f'"{mot}"')
# Transformer en une seule ligne
resultat = " ".join(mots)
print(resultat)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment