Skip to content

Commit

Permalink
Update entities_checker_util.py
Browse files Browse the repository at this point in the history
  • Loading branch information
jkshj21 authored Oct 16, 2023
1 parent 9d8d5b2 commit d5b15d3
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/dfcx_scrapi/tools/entities_checker_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,22 +178,22 @@ def _unpack_nested_entities(self, df, target_kind_type):
new_synonyms = []
is_nested_entity_type = True
for entity_value in entity_values:
if ('@' == entity_value[0] and
if ('@' == entity_value[0] and
(df['entity_type'] == entity_value[1::]).any()):
entity_value = entity_value[1::]
child_entity_type_row = (
child_entity_row = (
df.loc[df['entity_type'] == entity_value]
)
child_index = child_entity_type_row.index[0]
child_index = child_entity_row.index[0]
child_entity_type_kind = (
child_entity_type_row['kind'][child_index]
child_entity_row['kind'][child_index]
)
if child_entity_type_kind == target_kind_type:
child_entity_values = (
child_entity_type_row['entity_values'][child_index]
child_entity_row['entity_values'][child_index]
)
child_entity_synonyms = (
child_entity_type_row['synonyms'][child_index]
child_entity_row['synonyms'][child_index]
)
new_entity_values += child_entity_values
new_synonyms += child_entity_synonyms
Expand Down

0 comments on commit d5b15d3

Please sign in to comment.