2021-03-10

Mar 10 In-Class Exercise Thread.

Please post your solutions to the Mar 10 In-Class Exercise to this thread.
Best,
Chris
Please post your solutions to the Mar 10 In-Class Exercise to this thread. Best, Chris

-- Mar 10 In-Class Exercise Thread
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] => 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 )

-- Mar 10 In-Class Exercise Thread
str = "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"


Stemmed:
    [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
(Edited: 2021-03-10)
str = "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" <br><br> Stemmed: [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

-- Mar 10 In-Class Exercise Thread
Code:
<?php namespace vrinda\try;
use seekquarry\yioop\configs as SYC; use seekquarry\yioop\library as SYL; use seekquarry\yioop\library\Library; use seekquarry\yioop\library\PhraseParser;
require_once "vendor/autoload.php";
Library::init();
$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::stemTerms($phrase, 'en-US'));
Output:
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
)
(Edited: 2021-03-10)
Code: <?php namespace vrinda\try; use seekquarry\yioop\configs as SYC; use seekquarry\yioop\library as SYL; use seekquarry\yioop\library\Library; use seekquarry\yioop\library\PhraseParser; require_once "vendor/autoload.php"; Library::init(); $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::stemTerms($phrase, 'en-US')); ---- Output: 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 )

-- Mar 10 In-Class Exercise Thread
Code (test.php)
<?php
use seekquarry\yioop\Library as L;
use seekquarry\yioop\library\Library;
use seekquarry\yioop\library\PhraseParser;
require_once "vendor/autoload.php";
Library::init();
$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";
$locale = "en-US";
print_r(PhraseParser::stemTerms($phrase, $locale)); ?>
Result:
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
)
(Edited: 2021-03-10)
Code (test.php) <?php use seekquarry\yioop\Library as L; use seekquarry\yioop\library\Library; use seekquarry\yioop\library\PhraseParser; require_once "vendor/autoload.php"; Library::init(); $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"; $locale = "en-US"; print_r(PhraseParser::stemTerms($phrase, $locale)); ?> ---- Result: 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 )

-- Mar 10 In-Class Exercise Thread
Code: Results: 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 )
<nowiki> Code: <?php namespace alvin\yioop; use seekquarry\yioop\configs as SYC; use seekquarry\yioop\library as SYL; use seekquarry\yioop\library\Library; use seekquarry\yioop\library\PhraseParser; require_once "vendor/autoload.php"; Library::init(); $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::stemTerms($phrase, 'en-US')); ?> Results: 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 ) </nowiki>

-- Mar 10 In-Class Exercise Thread
code: <?php namespace cpollett\test_composer;
use seekquarry\yioop\configs as SYC; use seekquarry\yioop\library as SYL; use seekquarry\yioop\library\Library; use seekquarry\yioop\library\PhraseParser;
require_once "vendor/autoload.php";
Library::init(); $foo = PhraseParser::stemTerms("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", 'en-US'); print_r($foo);
Resource Description for Screen Shot 2021-03-10 at 7.06.01 PM.png
code: <?php namespace cpollett\test_composer; use seekquarry\yioop\configs as SYC; use seekquarry\yioop\library as SYL; use seekquarry\yioop\library\Library; use seekquarry\yioop\library\PhraseParser; require_once "vendor/autoload.php"; Library::init(); $foo = PhraseParser::stemTerms("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", 'en-US'); print_r($foo); ((resource:Screen Shot 2021-03-10 at 7.06.01 PM.png|Resource Description for Screen Shot 2021-03-10 at 7.06.01 PM.png))
2021-03-11

-- Mar 10 In-Class Exercise Thread
$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"
Stemmer Output: 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
)
$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" Stemmer Output: 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 )

-- Mar 10 In-Class Exercise Thread
Code: <?php namespace sdomala\composer; use seekquarry\yioop\configs as SYC; use seekquarry\yioop\library as SYL; use seekquarry\yioop\library\Library; use seekquarry\yioop\library\PhraseParser;
require_once "vendor/autoload.php";
Library::init(); $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::stemTerms($phrase, 'en-US')); ?>
Results: 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
)
(Edited: 2021-03-11)
Code: <?php namespace sdomala\composer; use seekquarry\yioop\configs as SYC; use seekquarry\yioop\library as SYL; use seekquarry\yioop\library\Library; use seekquarry\yioop\library\PhraseParser; require_once "vendor/autoload.php"; Library::init(); $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::stemTerms($phrase, 'en-US')); ?> Results: 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 )
2021-03-14

-- Mar 10 In-Class Exercise Thread
* Code:
<nowiki> * Code: <?php namespace cdevangi\test_composer; use seekquarry\yioop\configs as SYC; use seekquarry\yioop\library as SYL; use seekquarry\yioop\library\Library; use seekquarry\yioop\library\PhraseParser; require_once "vendor/autoload.php"; Library::init(); $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"; echo "Hyphenate Entities output -->\n"; print_r(PhraseParser::hyphenateEntities($phrase, 'en-US')); echo "\n\nStem Terms output -->\n"; print_r(PhraseParser::stemTerms($phrase, 'en-US')); echo SYL\crawlHash(SYC\NAME_SERVER . "1234"); * Output: Hyphenate Entities output --> 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 Stem Terms output --> 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 ) </nowiki>
[ Next ]
X