protected function ContributorNames::checkIsOrganization in Bibliography Module 7.2
Check if a string represents an organization
Compares the string against known organization words e.g. "Center" or "Team"
Parameters
string $str:
Return value
boolean
1 call to ContributorNames::checkIsOrganization()
- ContributorNames::analyze in lib/
msrc-authortool/ src/ Analyzer/ ContributorNames.php - Analyze a string
File
- lib/
msrc-authortool/ src/ Analyzer/ ContributorNames.php, line 136
Class
- ContributorNames
- Match Contributor Names with Predefined Regex
Namespace
AnalyzerCode
protected function checkIsOrganization($str) {
//Lowercase
$str = strtolower($str);
//Check against all of the org words
foreach ($this->orgWords as $word) {
if (preg_match("/\\b{$word}\\b/i", $str)) {
return true;
}
}
//If made it here
return false;
}