I'm using this API and the DetectEntities
method. It's recognizing the text and its type correctly, but I need it to be able to split the name as necessary.
There are two fields in the form:
The documentation doesn't seem to have anything regarding this. When sent to the backend, I need it to properly parse into XML, for example:
<name>
<surname>Doe</surname>
<given-names>John</given-names>
<suffix>III</suffix>
</name>.
I'm using the API as,
$response = $GLOBALS['ComprehendClient']->detectEntities([
'LanguageCode' => 'en',
'Text' => 'John Doe Jr'
]);
dd($response);
die();
It dd
s with:
Which is obviously not what I need. It will always recognize the name, but there is no way to predict how I'd need to split the string in the future.
I really like this API, and I haven't really found anything else that's even close to accomplishing to what I need. Maybe it's just simply impossible with this one. It'd be easier to just add a third column Suffix
and just circumvent it that way.