-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[formrecognizer] Rename DocumentElement to DocumentContentElement #21323
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2125,8 +2125,8 @@ def from_dict(cls, data): | |
) | ||
|
||
|
||
class DocumentElement(object): | ||
"""A DocumentElement. | ||
class DocumentContentElement(object): | ||
"""A DocumentContentElement. | ||
|
||
:ivar content: Text content of the word. | ||
:vartype content: str | ||
|
@@ -2143,13 +2143,13 @@ def __init__(self, **kwargs): | |
self.kind = kwargs.get("kind", None) | ||
|
||
def __repr__(self): | ||
return "DocumentElement(content={}, bounding_box={}, kind={})".format( | ||
return "DocumentContentElement(content={}, bounding_box={}, kind={})".format( | ||
self.content, self.bounding_box, self.kind | ||
) | ||
|
||
def to_dict(self): | ||
# type: () -> dict | ||
"""Returns a dict representation of DocumentElement. | ||
"""Returns a dict representation of DocumentContentElement. | ||
|
||
:return: dict | ||
:rtype: dict | ||
|
@@ -2164,12 +2164,12 @@ def to_dict(self): | |
|
||
@classmethod | ||
def from_dict(cls, data): | ||
# type: (dict) -> DocumentElement | ||
"""Converts a dict in the shape of a DocumentElement to the model itself. | ||
# type: (dict) -> DocumentContentElement | ||
"""Converts a dict in the shape of a DocumentContentElement to the model itself. | ||
|
||
:param dict data: A dictionary in the shape of DocumentElement. | ||
:return: DocumentElement | ||
:rtype: DocumentElement | ||
:param dict data: A dictionary in the shape of DocumentContentElement. | ||
:return: DocumentContentElement | ||
:rtype: DocumentContentElement | ||
""" | ||
return cls( | ||
content=data.get("content", None), | ||
|
@@ -2844,7 +2844,7 @@ def from_dict(cls, data): | |
) | ||
|
||
|
||
class DocumentSelectionMark(DocumentElement): | ||
class DocumentSelectionMark(DocumentContentElement): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just wanted to make sure with .NET here if we do have an inheritance currently built-in between these elements (DocumentWord, DocumentSelectionMark)? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We currently don't https://apiview.dev/Assemblies/Review/cf2c57b3d4c44ef08c2e8284f7441a2d#Azure.AI.FormRecognizer.DocumentAnalysis.DocumentWord I have to admit that we haven't spent time looking into this with a design perspective, so the reason why it currently isn't is that there is no explicit dependency in the swagger |
||
"""A selection mark object representing check boxes, radio buttons, and other elements indicating a selection. | ||
|
||
:ivar state: State of the selection mark. Possible values include: "selected", | ||
|
@@ -3408,7 +3408,7 @@ def _from_generated(cls, op, api_version): # pylint: disable=arguments-differ | |
) | ||
|
||
|
||
class DocumentWord(DocumentElement): | ||
class DocumentWord(DocumentContentElement): | ||
"""A word object consisting of a contiguous sequence of characters. For non-space delimited languages, | ||
such as Chinese, Japanese, and Korean, each character is represented as its own word. | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm open if there are better names, but I wanted to get this updated since it seems most likely that it wont stay as a general
DocumentElement
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense to me