<?php namespace lakshmiprasanna\test; use seekquarry\yioop\library\Library; use seekquarry\yioop\library\PhraseParser; require_once "vendor/autoload.php"; Library::init(true); $in = "The prime minister is the head of government for Canada, chairs and selects the membership of the Cabinet, and advises the Crown on the exercise of executive power and much of the royal prerogative."; PhraseParser::hyphenateEntities($in, 'en-US'); echo $in; echo "\n\n"; $result = PhraseParser::stemTerms($in, 'en-US'); var_dump($result);
<?php namespace rebe2\test_composer; use seekquarry\yioop\library\PhraseParser; require_once "vendor/autoload.php"; $input = "The prime minister is the head of government for Canada, chairs and selects the membership of the Cabinet, and advises the Crown on the exercise of executive power and much of the royal prerogative."; PhraseParser::hyphenateEntities($input, 'en-US'); $stemmed = PhraseParser::stemTerms($input, 'en-US'); var_dump($stemmed); array(32) { [0]=> string(3) "The" [1]=> string(12) "prime-minist" [2]=> string(2) "is" [3]=> string(3) "the" [4]=> string(4) "head" [5]=> string(2) "of" [6]=> string(6) "govern" [7]=> string(3) "for" [8]=> string(7) "Canada," [9]=> string(5) "chair" [10]=> string(3) "and" [11]=> string(6) "select" [12]=> string(3) "the" [13]=> string(10) "membership" [14]=> string(2) "of" [15]=> string(3) "the" [16]=> string(8) "Cabinet," [17]=> string(3) "and" [18]=> string(5) "advis" [19]=> string(3) "the" [20]=> string(5) "Crown" [21]=> string(2) "on" [22]=> string(3) "the" [23]=> string(7) "exercis" [24]=> string(2) "of" [25]=> string(15) "executive-power" [26]=> string(3) "and" [27]=> string(4) "much" [28]=> string(2) "of" [29]=> string(3) "the" [30]=> string(5) "royal" [31]=> string(12) "prerogative."}(Edited: 2022-03-14)
<?php namespace priyusha\test; use seekquarry\yioop\library\Library; use seekquarry\yioop\library\PhraseParser; require_once "vendor/autoload.php"; Library::init(true); $s = "The prime minister is the head of government for Canada, chairs and selects the membership of the Cabinet, and advises the Crown on the exercise of executive power and much of the royal prerogative."; PhraseParser::hyphenateEntities($in, 'en-US'); echo $s; $result = PhraseParser::stemTerms($in, 'en-US'); var_dump($result);
use seekquarry\yioop\library\Library; use seekquarry\yioop\library\PhraseParser; require_once "vendor/autoload.php"; Library::init(true); $string = "The prime minister is the head of government for Canada, chairs and selects the membership of the Cabinet, and advises the Crown on the exercise of executive power and much of the royal prerogative."; PhraseParser::hyphenateEntities($in, 'en-US'); echo $string;
$result = PhraseParser::stemTerms($in, 'en-US'); var_dump($result);
use seekquarry\yioop\library\Library; use seekquarry\yioop\library\PhraseParser; require_once "vendor/autoload.php"; Library::init(true);
$result = PhraseParser::stemTerms($in, 'en-US'); var_dump($result);