Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Jaime Collado
/
textflow
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
1
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
3c88f42c
authored
Jun 16, 2022
by
Arturo Montejo Ráez
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
inicializeSequence -> initializeSequence
parent
5fdda07f
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
12 additions
and
12 deletions
textflow/Sequence.py
textflow/SequenceDirectory.py
textflow/SequenceFile.py
textflow/SequenceString.py
textflow/SequenceToken.py
textflow/Sequence.py
View file @
3c88f42c
...
@@ -52,7 +52,7 @@ class Sequence(ABC):
...
@@ -52,7 +52,7 @@ class Sequence(ABC):
"""
"""
@abstractmethod
@abstractmethod
def
ini
c
ializeSequence
(
self
,
format
):
def
ini
t
ializeSequence
(
self
,
format
):
'''
'''
Initializes the attributes of a sequence.
Initializes the attributes of a sequence.
...
...
textflow/SequenceDirectory.py
View file @
3c88f42c
...
@@ -31,7 +31,7 @@ class SequenceDirectory(Sequence):
...
@@ -31,7 +31,7 @@ class SequenceDirectory(Sequence):
listTokenizer: a list with the tokenizer to inicialize the different subsequences
listTokenizer: a list with the tokenizer to inicialize the different subsequences
'''
'''
self
.
ini
c
ializeSequence
(
"directory"
)
self
.
ini
t
ializeSequence
(
"directory"
)
self
.
metadata
[
"nameFiles"
]
=
[]
self
.
metadata
[
"nameFiles"
]
=
[]
self
.
metadata
[
"directoriesPath"
]
=
[]
self
.
metadata
[
"directoriesPath"
]
=
[]
if
not
listTokenizer
or
listTokenizer
==
None
:
if
not
listTokenizer
or
listTokenizer
==
None
:
...
@@ -55,14 +55,14 @@ class SequenceDirectory(Sequence):
...
@@ -55,14 +55,14 @@ class SequenceDirectory(Sequence):
def
ini
c
ializeSequence
(
self
,
format
):
def
ini
t
ializeSequence
(
self
,
format
):
'''
'''
Initializes the attributes of a sequence.
Initializes the attributes of a sequence.
Args:
Args:
format: a string with the origin format of the sequence.
format: a string with the origin format of the sequence.
'''
'''
super
()
.
ini
c
ializeSequence
(
format
)
super
()
.
ini
t
ializeSequence
(
format
)
def
__str__
(
self
):
def
__str__
(
self
):
'''
'''
...
...
textflow/SequenceFile.py
View file @
3c88f42c
...
@@ -28,7 +28,7 @@ class SequenceFile (Sequence):
...
@@ -28,7 +28,7 @@ class SequenceFile (Sequence):
listTokenizer: a list with the tokenizer to inicialize the different subsequences
listTokenizer: a list with the tokenizer to inicialize the different subsequences
'''
'''
self
.
ini
c
ializeSequence
(
"file"
)
self
.
ini
t
ializeSequence
(
"file"
)
with
open
(
src
,
"r"
)
as
f
:
with
open
(
src
,
"r"
)
as
f
:
txt
=
f
.
read
()
txt
=
f
.
read
()
self
.
metadata
[
"text"
]
=
txt
self
.
metadata
[
"text"
]
=
txt
...
@@ -40,14 +40,14 @@ class SequenceFile (Sequence):
...
@@ -40,14 +40,14 @@ class SequenceFile (Sequence):
def
ini
c
ializeSequence
(
self
,
format
):
def
ini
t
ializeSequence
(
self
,
format
):
'''
'''
Initializes the attributes of a sequence.
Initializes the attributes of a sequence.
Args:
Args:
format: a string with the origin format of the sequence.
format: a string with the origin format of the sequence.
'''
'''
super
()
.
ini
c
ializeSequence
(
format
)
super
()
.
ini
t
ializeSequence
(
format
)
def
__str__
(
self
):
def
__str__
(
self
):
'''
'''
...
...
textflow/SequenceString.py
View file @
3c88f42c
...
@@ -29,7 +29,7 @@ class SequenceString (Sequence):
...
@@ -29,7 +29,7 @@ class SequenceString (Sequence):
Raises:
Raises:
ValueError: If src isn't a string .
ValueError: If src isn't a string .
'''
'''
self
.
ini
c
ializeSequence
(
"string"
)
self
.
ini
t
ializeSequence
(
"string"
)
if
not
isinstance
(
src
,
str
):
if
not
isinstance
(
src
,
str
):
raise
ValueError
(
f
"{src} is not an instance of string"
)
raise
ValueError
(
f
"{src} is not an instance of string"
)
self
.
metadata
[
"text"
]
=
src
self
.
metadata
[
"text"
]
=
src
...
@@ -38,14 +38,14 @@ class SequenceString (Sequence):
...
@@ -38,14 +38,14 @@ class SequenceString (Sequence):
listTokenizer
=
[
WhitespaceTokenizer
()]
listTokenizer
=
[
WhitespaceTokenizer
()]
self
.
children
[
listLabel
[
0
]]
=
[
listClasses
[
0
](
token_src
,
listLabel
[
1
:],
listClasses
[
1
:],
listTokenizer
[
1
:])
for
token_src
in
listTokenizer
[
0
]
.
tokenize
(
src
)]
self
.
children
[
listLabel
[
0
]]
=
[
listClasses
[
0
](
token_src
,
listLabel
[
1
:],
listClasses
[
1
:],
listTokenizer
[
1
:])
for
token_src
in
listTokenizer
[
0
]
.
tokenize
(
src
)]
def
ini
c
ializeSequence
(
self
,
format
):
def
ini
t
ializeSequence
(
self
,
format
):
'''
'''
Initializes the attributes of a sequence.
Initializes the attributes of a sequence.
Args:
Args:
format: a string with the origin format of the sequence.
format: a string with the origin format of the sequence.
'''
'''
super
()
.
ini
c
ializeSequence
(
format
)
super
()
.
ini
t
ializeSequence
(
format
)
def
__str__
(
self
):
def
__str__
(
self
):
'''
'''
...
...
textflow/SequenceToken.py
View file @
3c88f42c
...
@@ -26,10 +26,10 @@ class SequenceToken (Sequence):
...
@@ -26,10 +26,10 @@ class SequenceToken (Sequence):
listTokenizer: a list with the tokenizer to inicialize the different subsequences
listTokenizer: a list with the tokenizer to inicialize the different subsequences
'''
'''
self
.
ini
c
ializeSequence
(
"token"
)
self
.
ini
t
ializeSequence
(
"token"
)
self
.
metadata
[
"text"
]
=
src
self
.
metadata
[
"text"
]
=
src
def
ini
c
ializeSequence
(
self
,
format
):
def
ini
t
ializeSequence
(
self
,
format
):
'''
'''
Initializes the attributes of a sequence.
Initializes the attributes of a sequence.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment