Skip to content
This repository has been archived by the owner on Sep 20, 2023. It is now read-only.

Commit

Permalink
chores: fixed small issue with start index problem (#56)
Browse files Browse the repository at this point in the history
* chores: fixed small issue with start index problem

* added missing update
  • Loading branch information
munkhuushmgl committed Nov 11, 2020
1 parent cc8c58d commit 7039a35
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion samples/snippets/batch_process_documents_sample_v1beta3.py
Expand Up @@ -110,7 +110,7 @@ def get_text(doc_element: dict, document: dict):
for segment in doc_element.text_anchor.text_segments:
start_index = (
int(segment.start_index)
if "start_index" in doc_element.text_anchor.__dict__
if segment in doc_element.text_anchor.text_segments
else 0
)
end_index = int(segment.end_index)
Expand Down
2 changes: 1 addition & 1 deletion samples/snippets/process_document_sample_v1beta3.py
Expand Up @@ -77,7 +77,7 @@ def get_text(doc_element: dict, document: dict):
for segment in doc_element.text_anchor.text_segments:
start_index = (
int(segment.start_index)
if segment.start_index in doc_element.text_anchor.text_segments
if segment in doc_element.text_anchor.text_segments
else 0
)
end_index = int(segment.end_index)
Expand Down
2 changes: 1 addition & 1 deletion samples/snippets/quickstart_sample_v1beta3.py
Expand Up @@ -70,7 +70,7 @@ def get_text(doc_element: dict, document: dict):
for segment in doc_element.text_anchor.text_segments:
start_index = (
int(segment.start_index)
if segment.start_index in doc_element.text_anchor.text_segments
if segment in doc_element.text_anchor.text_segments
else 0
)
end_index = int(segment.end_index)
Expand Down

0 comments on commit 7039a35

Please sign in to comment.