Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Carlos-Francisco Méndez-Cruz
/
automatic-extraction-growth-conditions
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Authored by
Kevin Meza Landeros
2019-10-30 18:58:09 -0600
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
f4c02369ceb5c64fc80d59411599431952f22ab4
f4c02369
1 parent
d3dfa5cc
Update filtering.py
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
10 deletions
CoreNLP/bin/filtering.py
CoreNLP/bin/filtering.py
View file @
f4c0236
...
...
@@ -81,16 +81,17 @@ if __name__ == '__main__':
# Se abre el segundo archivo
with
open
(
os
.
path
.
join
(
args
.
outputPath
,
"MultWord_Alphanum.txt"
),
"w+"
)
as
oFile
:
for
index
,
row
in
file
.
iterrows
():
# La bandera en 1 indica que ninguna palabra de la primer columna tiene caracteres NO alfanumericos
# La bandera en 0 indica que al menos una palabra tienes caracteres NO alfanumericos.
bandera
=
1
# Con el for se va a verificando la presencia de caracteres alfanumericos en cada palabra de la primera columna
for
i
in
range
(
0
,
len
(
row
[
0
]
.
split
(
" "
))):
if
len
(
row
[
0
]
.
split
(
" "
))
!=
1
and
alphanum_and_NOGreek
(
str
(
row
[
0
]
.
split
(
" "
)[
i
]))
==
False
:
bandera
=
0
if
bandera
==
1
:
conditions_2
.
append
(
row
[
0
])
lines_2
.
append
(
row
[
1
])
if
len
(
row
[
0
]
.
split
(
" "
))
!=
1
# La bandera en 1 indica que ninguna palabra de la primer columna tiene caracteres NO alfanumericos
# La bandera en 0 indica que al menos una palabra tienes caracteres NO alfanumericos.
bandera
=
1
# Con el for se va a verificando la presencia de caracteres alfanumericos en cada palabra de la primera columna
for
i
in
range
(
0
,
len
(
row
[
0
]
.
split
(
" "
))):
if
alphanum_and_NOGreek
(
str
(
row
[
0
]
.
split
(
" "
)[
i
]))
==
False
:
bandera
=
0
if
bandera
==
1
:
conditions_2
.
append
(
row
[
0
])
lines_2
.
append
(
row
[
1
])
# Se escriben en el primer archivo aquellos valores que cumplen las condiciones.
for
i
in
range
(
len
(
lines_2
)):
oFile
.
write
(
conditions_2
[
i
]
+
"
\t
"
+
lines_2
[
i
]
+
'
\n
'
)
...
...
Please
register
or
login
to post a comment