Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mapaie
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Tiphaine Viard
mapaie
Commits
822ba049
Commit
822ba049
authored
1 year ago
by
Tiphaine Viard
Browse files
Options
Downloads
Patches
Plain Diff
Script that creates Iramuteq corpus from txts/ outputs
parent
94e9acc5
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
create_corpus.py
+25
-0
25 additions, 0 deletions
create_corpus.py
with
25 additions
and
0 deletions
create_corpus.py
0 → 100644
+
25
−
0
View file @
822ba049
import
sys
import
glob
from
pathlib
import
Path
LOG_FILE
=
"
corpus.log
"
OUT_FILE
=
"
corpus.txt
"
log_fp
=
open
(
LOG_FILE
,
"
w
"
)
corpus_file
=
open
(
OUT_FILE
,
"
w
"
,
encoding
=
"
utf-8
"
)
for
fname
in
glob
.
glob
(
"
./txts/*.txt
"
):
print
(
fname
)
try
:
f
=
open
(
fname
,
"
r
"
)
print
(
"
**** *mapaie
"
,
file
=
corpus_file
)
print
(
f
.
read
().
strip
(),
file
=
corpus_file
)
f
.
close
()
except
Exception
as
e
:
print
(
f
"
Err
{
fname
}
:
{
e
}
"
)
pass
log_fp
.
close
()
corpus_file
.
close
()
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment