更新ocr
This commit is contained in:
parent
1bc49b39fa
commit
d2fa4826cc
@ -436,7 +436,10 @@ class XunFeiController extends BaseApiController
|
|||||||
$textArray = json_decode(base64_decode($encodeText), true);
|
$textArray = json_decode(base64_decode($encodeText), true);
|
||||||
$lineArray = $textArray['pages'][0]['lines'] ?? [];
|
$lineArray = $textArray['pages'][0]['lines'] ?? [];
|
||||||
foreach($lineArray as $item) {
|
foreach($lineArray as $item) {
|
||||||
$text[] = $item['words'][0]['content'] ?? '';
|
$content = $item['words'][0]['content'] ?? '';
|
||||||
|
if ($content) {
|
||||||
|
$text[] = $content;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch (GuzzleException $e) {
|
} catch (GuzzleException $e) {
|
||||||
return $this->fail($e->getMessage());
|
return $this->fail($e->getMessage());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user