2019-09-24

Sep 25 In-Class Exercise Thread.

Post your solutions to the Sep 25 In-Class Exercise to this thread.
Best,
Chris
Post your solutions to the Sep 25 In-Class Exercise to this thread. Best, Chris
2019-09-25

-- Sep 25 In-Class Exercise Thread
 <?php
 namespace aniket\test_composer;
 use seekquarry\yioop\configs as SYC;
 use seekquarry\yioop\library\Library;
 use seekquarry\yioop\library\PhraseParser;
 require_once "vendor/autoload.php";
 $string_1 = " the Second World War";
 Library::init();
 PhraseParser::hyphenateEntities($string_1, "en-US");
 $string_1 = PhraseParser::stemTerms($string_1, 'en-US');
 print_r( $string_1);
(Edited: 2019-09-25)
<?php namespace aniket\test_composer; use seekquarry\yioop\configs as SYC; use seekquarry\yioop\library\Library; use seekquarry\yioop\library\PhraseParser; require_once "vendor/autoload.php"; $string_1 = " the Second World War"; Library::init(); PhraseParser::hyphenateEntities($string_1, "en-US"); $string_1 = PhraseParser::stemTerms($string_1, 'en-US'); print_r( $string_1);

-- Sep 25 In-Class Exercise Thread
 <?php
 namespace sushant\test_composer;
 
 use seekquarry\yioop\configs as SYC; 
 use seekquarry\yioop\library as SYL;
 use seekquarry\yioop\library\PhraseParser;
 require_once "vendor/autoload.php";
 
 $phrase = "For many years after their introduction, vacuum cleaners remained a luxury item, but after the Second World War 
 they became common among the middle classes";
 PhraseParser::hyphenateEntities($phrase, 'en-US');
 print_r($phrase);
 print_r(PhraseParser::stemTerms($phrase, 'en-US'));
(Edited: 2019-09-25)
<?php namespace sushant\test_composer; use seekquarry\yioop\configs as SYC; use seekquarry\yioop\library as SYL; use seekquarry\yioop\library\PhraseParser; require_once "vendor/autoload.php"; $phrase = "For many years after their introduction, vacuum cleaners remained a luxury item, but after the Second World War they became common among the middle classes"; PhraseParser::hyphenateEntities($phrase, 'en-US'); print_r($phrase); print_r(PhraseParser::stemTerms($phrase, 'en-US'));

-- Sep 25 In-Class Exercise Thread
<?php
namespace cpollett\test_composer;
use seekquarry\yioop\configs as SYC;
use seekquarry\yioop\library as SYL;
use seekquarry\yioop\library\PhraseParser;
require_once "vendor/autoload.php";
$tmp = "For many years after their introduction, vacuum cleaners remained a luxury item, but after the Second World War, they became common among the middle classes";
$tmp1 = "second world war";
PhraseParser::hyphenateEntities($tmp, 'en-US');
PhraseParser::hyphenateEntities($tmp1,'en-US');
echo "\nHyphenated String1: === ";
echo $tmp;
echo "\nHyphanated String2: === ";
echo $tmp1;
echo "\n";
print_r(PhraseParser::stemTerms($tmp, 'en-US'));
print_r(PhraseParser::stemTerms($tmp1, 'en-US'));
Ouput:
(base) C02Z63W4LVDL:hyphen aparna.kale$ php index.php
Hyphenated String1: === For many years after their introduction, vacuum cleaners remained a luxury item, but after the Second World War, they became common among the middle classes
Hyphanated String2: === second world-war Array (
    [0] => For
    [1] => mani
    [2] => year
    [3] => after
    [4] => their
    [5] => introduction,
    [6] => vacuum
    [7] => cleaner
    [8] => remain
    [9] => a
    [10] => luxuri
    [11] => item,
    [12] => but
    [13] => after
    [14] => the
    [15] => Second
    [16] => World
    [17] => War,
    [18] => thei
    [19] => becam
    [20] => common
    [21] => among
    [22] => the
    [23] => middl
    [24] => class
) Array (
    [0] => second
    [1] => world-war
) (base) C02Z63W4LVDL:hyphen aparna.kale$
(Edited: 2019-09-25)
<?php namespace cpollett\test_composer; use seekquarry\yioop\configs as SYC; use seekquarry\yioop\library as SYL; use seekquarry\yioop\library\PhraseParser; require_once "vendor/autoload.php"; $tmp = "For many years after their introduction, vacuum cleaners remained a luxury item, but after the Second World War, they became common among the middle classes"; $tmp1 = "second world war"; PhraseParser::hyphenateEntities($tmp, 'en-US'); PhraseParser::hyphenateEntities($tmp1,'en-US'); echo "\nHyphenated String1: === "; echo $tmp; echo "\nHyphanated String2: === "; echo $tmp1; echo "\n"; print_r(PhraseParser::stemTerms($tmp, 'en-US')); print_r(PhraseParser::stemTerms($tmp1, 'en-US')); '''Ouput:''' (base) C02Z63W4LVDL:hyphen aparna.kale$ php index.php Hyphenated String1: === For many years after their introduction, vacuum cleaners remained a luxury item, but after the Second World War, they became common among the middle classes Hyphanated String2: === second world-war Array ( [0] => For [1] => mani [2] => year [3] => after [4] => their [5] => introduction, [6] => vacuum [7] => cleaner [8] => remain [9] => a [10] => luxuri [11] => item, [12] => but [13] => after [14] => the [15] => Second [16] => World [17] => War, [18] => thei [19] => becam [20] => common [21] => among [22] => the [23] => middl [24] => class ) Array ( [0] => second [1] => world-war ) (base) C02Z63W4LVDL:hyphen aparna.kale$

-- Sep 25 In-Class Exercise Thread
<?php
namespace cpollett\test_composer;
use seekquarry\yioop\configs as SYC;
use seekquarry\yioop\library as SYL;
use seekquarry\yioop\library\PhraseParser;
require_once "vendor/autoload.php";
$tmp="For many years after their introduction, vacuum cleaners remained a luxury item, but after the Second World War, they became common among the middle classes";
$tmp1="Second World War";
echo $tmp;
echo $tmp1;
PhraseParser::hyphenateEntities($tmp,'en-US');
PhraseParser::hyphenateEntities($tmp1,'en-US');
print_r(PhraseParser::stemTerms("$tmp", 'en-US'));
print_r(PhraseParser::stemTerms("$tmp1", 'en-US'));
echo SYL\crawlHash(SYC\NAME_SERVER . "1234");
Output: Underlined text
For many years after their introduction, vacuum cleaners remained a luxury item, but after the Second World War, they became common among the middle classesSecond World WarArray (
    [0] => For
    [1] => mani
    [2] => year
    [3] => after
    [4] => their
    [5] => introduction,
    [6] => vacuum
    [7] => cleaner
    [8] => remain
    [9] => a
    [10] => luxuri
    [11] => item,
    [12] => but
    [13] => after
    [14] => the
    [15] => Second
    [16] => World
    [17] => War,
    [18] => thei
    [19] => becam
    [20] => common
    [21] => among
    [22] => the
    [23] => middl
    [24] => class
) Array (
    [0] => Second
    [1] => World-War
) joQWpC4Sdy4(base) Govinds-MacBook-Pro:composer snehaldhumal$ vi test2.php
(Edited: 2019-09-25)
<?php namespace cpollett\test_composer; use seekquarry\yioop\configs as SYC; use seekquarry\yioop\library as SYL; use seekquarry\yioop\library\PhraseParser; require_once "vendor/autoload.php"; $tmp="For many years after their introduction, vacuum cleaners remained a luxury item, but after the Second World War, they became common among the middle classes"; $tmp1="Second World War"; echo $tmp; echo $tmp1; PhraseParser::hyphenateEntities($tmp,'en-US'); PhraseParser::hyphenateEntities($tmp1,'en-US'); print_r(PhraseParser::stemTerms("$tmp", 'en-US')); print_r(PhraseParser::stemTerms("$tmp1", 'en-US')); echo SYL\crawlHash(SYC\NAME_SERVER . "1234"); '''Output:'''<u>Underlined text</u> For many years after their introduction, vacuum cleaners remained a luxury item, but after the Second World War, they became common among the middle classesSecond World WarArray ( [0] => For [1] => mani [2] => year [3] => after [4] => their [5] => introduction, [6] => vacuum [7] => cleaner [8] => remain [9] => a [10] => luxuri [11] => item, [12] => but [13] => after [14] => the [15] => Second [16] => World [17] => War, [18] => thei [19] => becam [20] => common [21] => among [22] => the [23] => middl [24] => class ) Array ( [0] => Second [1] => World-War ) joQWpC4Sdy4(base) Govinds-MacBook-Pro:composer snehaldhumal$ vi test2.php

-- Sep 25 In-Class Exercise Thread
<?php
namespace sunhera\test_composer;
use seekquarry\yioop\configs as SYC; use seekquarry\yioop\library as SYL; use seekquarry\yioop\library\PhraseParser;
require_once "vendor/autoload.php";
$tmp = " the Second World War"; Library::init(); PhraseParser::hyphenateEntities($tmp, "en-US"); print_r( $tmp); print_r(PhraseParser::stemTerms($tmp, "en-US"));
<?php namespace sunhera\test_composer; use seekquarry\yioop\configs as SYC; use seekquarry\yioop\library as SYL; use seekquarry\yioop\library\PhraseParser; require_once "vendor/autoload.php"; $tmp = " the Second World War"; Library::init(); PhraseParser::hyphenateEntities($tmp, "en-US"); print_r( $tmp); print_r(PhraseParser::stemTerms($tmp, "en-US"));

-- Sep 25 In-Class Exercise Thread
 <?php
 namespace test_composer;
 use seekquarry\yioop\library\PhraseParser;
 require_once "vendor/autoload.php";
 $input =  "For many years after their introduction vacuum cleaners remained a luxury 
 item, 
 but after the Second World War they became common among the middle classes";
 
 PhraseParser::hyphenateEntities($input, 'en-US');
 echo($input);
 
 ?>
<?php namespace test_composer; use seekquarry\yioop\library\PhraseParser; require_once "vendor/autoload.php"; $input = "For many years after their introduction vacuum cleaners remained a luxury item, but after the Second World War they became common among the middle classes"; PhraseParser::hyphenateEntities($input, 'en-US'); echo($input); ?>

-- Sep 25 In-Class Exercise Thread
<nowiki><?php namespace iprathamkumkar\composer; use seekquarry\yioop\configs as SYC; use seekquarry\yioop\library as SYL; use seekquarry\yioop\library\PhraseParser; require_once "vendor/autoload.php"; $temp = "For many years after their introduction, vacuum cleaners remained a luxury item, until after the Second World War"; PhraseParser::hyphenateEntities($temp, 'en-US'); print_r($temp); print_r(PhraseParser::stemTerms($temp, 'en-US')); php index.php For many years after their introduction, vacuum cleaners remained a luxury item, until after the Second World-WarArray ( [0] => For [1] => mani [2] => year [3] => after [4] => their [5] => introduction, [6] => vacuum [7] => cleaner [8] => remain [9] => a [10] => luxuri [11] => item, [12] => until [13] => after [14] => the [15] => Second [16] => World-War )</nowiki>

-- Sep 25 In-Class Exercise Thread
 <?php 
 namespace ashutosh\test_composer;
 
  
 use seekquarry\yioop\library\Library; 
 use seekquarry\yioop\library\PhraseParser;
 
 require_once "vendor/autoload.php";
  Library::init();
 
 $Temp = " For many years after their introduction vacuum cleaners remained a luxury item 
 but after the Second World War they became common among the middle classes"; 
 PhraseParser::hyphenateEntities($Temp, "en-US");
 print_r( $Temp );
 print_r(PhraseParser::stemTerms($Temp, 'en-US'));
<?php namespace ashutosh\test_composer; use seekquarry\yioop\library\Library; use seekquarry\yioop\library\PhraseParser; require_once "vendor/autoload.php"; Library::init(); $Temp = " For many years after their introduction vacuum cleaners remained a luxury item but after the Second World War they became common among the middle classes"; PhraseParser::hyphenateEntities($Temp, "en-US"); print_r( $Temp ); print_r(PhraseParser::stemTerms($Temp, 'en-US'));

-- Sep 25 In-Class Exercise Thread
<?php namespace qianhui\test_composer; use seekquarry\yioop\configs as SYC; use seekquarry\yioop\library as SYL; use seekquarry\yioop\library\PhraseParser;
require_once "vendor/autoload.php"; $phrase = "For many years after their introduction, vacuum cleaners remained a luxury item, but after the Second World War they became common among the middle classes"; print_r(PhraseParser::hyphenateEntities($phrase, 'en-US')); print_r($phrase); print_r(PhraseParser::stemTerms($phrase, 'en-US'));
For many years after their introduction, vacuum cleaners remained a luxury item, but after the Second World-War they became common among the middle classesArray (
    [0] => For
    [1] => mani
    [2] => year
    [3] => after
    [4] => their
    [5] => introduction,
    [6] => vacuum
    [7] => cleaner
    [8] => remain
    [9] => a
    [10] => luxuri
    [11] => item,
    [12] => but
    [13] => after
    [14] => the
    [15] => Second
    [16] => World-War
    [17] => thei
    [18] => becam
    [19] => common
    [20] => among
    [21] => the
    [22] => middl
    [23] => class
)
<?php namespace qianhui\test_composer; use seekquarry\yioop\configs as SYC; use seekquarry\yioop\library as SYL; use seekquarry\yioop\library\PhraseParser; require_once "vendor/autoload.php"; $phrase = "For many years after their introduction, vacuum cleaners remained a luxury item, but after the Second World War they became common among the middle classes"; print_r(PhraseParser::hyphenateEntities($phrase, 'en-US')); print_r($phrase); print_r(PhraseParser::stemTerms($phrase, 'en-US')); For many years after their introduction, vacuum cleaners remained a luxury item, but after the Second World-War they became common among the middle classesArray ( [0] => For [1] => mani [2] => year [3] => after [4] => their [5] => introduction, [6] => vacuum [7] => cleaner [8] => remain [9] => a [10] => luxuri [11] => item, [12] => but [13] => after [14] => the [15] => Second [16] => World-War [17] => thei [18] => becam [19] => common [20] => among [21] => the [22] => middl [23] => class )
[ Next ]
X