Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
easymatcher
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Redmine
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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
nlpworkers
easymatcher
Commits
8864e268
Commit
8864e268
authored
Jun 26, 2023
by
Jakub-Goluch
Browse files
Options
Downloads
Patches
Plain Diff
Add feature to check whether document has a valid json/jsonl format, add tests
parent
73c0b676
No related branches found
No related tags found
1 merge request
!4
Resolve "Read not only .txt files"
Pipeline
#11286
failed
Jun 26, 2023
Stage: check_style
Stage: tests
Stage: pages
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/easymatcher_worker.py
+5
-2
5 additions, 2 deletions
src/easymatcher_worker.py
with
5 additions
and
2 deletions
src/easymatcher_worker.py
+
5
−
2
View file @
8864e268
...
@@ -20,9 +20,12 @@ class EasymatcherWorker(nlp_ws.NLPWorker):
...
@@ -20,9 +20,12 @@ class EasymatcherWorker(nlp_ws.NLPWorker):
It relies on the use of an easymatcher tool which can be found he under -
It relies on the use of an easymatcher tool which can be found he under -
https://gitlab.clarin-pl.eu/knowledge-extraction/tools/easymatcher
https://gitlab.clarin-pl.eu/knowledge-extraction/tools/easymatcher
"""
"""
@staticmethod
@staticmethod
def
is_jsonl
(
document_path
:
str
|
Path
)
->
bool
:
def
is_jsonl
(
"""
Validates whether text file has json/jsonl structure and has
"
text
"
keyword
"""
document_path
:
str
|
Path
)
->
bool
:
"""
Validates whether text file has json/jsonl structure and has
"
text
"
keyword.
"""
try
:
try
:
with
open
(
document_path
,
'
r
'
,
encoding
=
"
utf-8
"
)
as
file
:
with
open
(
document_path
,
'
r
'
,
encoding
=
"
utf-8
"
)
as
file
:
for
line
in
file
:
for
line
in
file
:
...
...
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