Skip to content

Commit ba1d0ab

Browse files
committed
Clean up comments and mid variable
Clean up comments and mid variable
1 parent 221239a commit ba1d0ab

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

language/src/analyze_entities.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ function analyze_entities($text, $projectId = null)
5252
7 => 'OTHER',
5353
];
5454
$document = new Document();
55-
// Add text as content and set document type to PLAIN_TEXT, otherwise you get a Code: 3 INVALID_ARGUMENT error
55+
// Add text as content and set document type to PLAIN_TEXT
5656
$document->setContent($text)->setType(1);
5757
// Call the analyzeEntities function
5858
$response = $languageServiceClient->analyzeEntities($document, []);
@@ -66,7 +66,7 @@ function analyze_entities($text, $projectId = null)
6666
printf('Wikipedia URL: %s' . PHP_EOL, $entity->getMetadata()->offsetGet('wikipedia_url'));
6767
}
6868
if($entity->getMetadata()->offsetExists('mid')) {
69-
printf('Knowledge Graph MID: %s' . PHP_EOL, $mid = $entity->getMetadata()->offsetGet('mid'));
69+
printf('Knowledge Graph MID: %s' . PHP_EOL, $entity->getMetadata()->offsetGet('mid'));
7070
}
7171
printf(PHP_EOL);
7272
}

language/src/analyze_entities_from_file.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ function analyze_entities_from_file($gcsUri, $projectId = null)
5353
7 => 'OTHER',
5454
];
5555
$document = new Document();
56-
// Pass GCS URI and set document type to PLAIN_TEXT, otherwise you get a Code: 3 INVALID_ARGUMENT error
56+
// Pass GCS URI and set document type to PLAIN_TEXT
5757
$document->setGcsContentUri($gcsUri)->setType(1);
5858
// Call the analyzeEntities function
5959
$response = $languageServiceClient->analyzeEntities($document, []);
@@ -67,7 +67,7 @@ function analyze_entities_from_file($gcsUri, $projectId = null)
6767
printf('Wikipedia URL: %s' . PHP_EOL, $entity->getMetadata()->offsetGet('wikipedia_url'));
6868
}
6969
if($entity->getMetadata()->offsetExists('mid')) {
70-
printf('Knowledge Graph MID: %s' . PHP_EOL, $mid = $entity->getMetadata()->offsetGet('mid'));
70+
printf('Knowledge Graph MID: %s' . PHP_EOL, $entity->getMetadata()->offsetGet('mid'));
7171
}
7272
printf(PHP_EOL);
7373
}

0 commit comments

Comments
 (0)