operator: active-buffer

    description:
        active-buffer[N, t] seq
        active-buffer[N, t, op] seq
        an early version of 'actively' reading a sentence, and use back-ground knowledge to work out what is said
        not super impressive, and in many cases 'explain' does a better job.

    examples:
        -- learn a simple face:
        |body part: face> => 2|eye> + |nose> + 2|ear> + 2|lip> + |hair>
    
        active-buffer[7,0] (2|eye> + |nose>)
            0.375|body part: face>
            
        active-buffer[7,0] (2|eye> + |nose> + 2|ear> + 2|lip> + |hair>)
            |body part: face>

        
        -- reset the console:
        reset
        load internet-acronyms.sw
        apply-word |*> #=> |word:> __ |_self>
        remove-punctuation (*) #=> string-replace(|_self>, split[""] |:;.,!?$-"'>, |>)
        read |*> #=> apply-word ssplit[" "] to-lower remove-punctuation remove-prefix["text: "] |_self>
        active-buffer[7,0] read |text: fwiw I think it is all fud imho, lol. thx.>
            |phrase: For What It's Worth> . |> . |> . |> . |> . |> . |phrase: Fear, Uncertainty, Doubt> . |phrase: In My Humble Opinion> . |phrase: Laughing Out Loud> . |phrase: Thanks>

        reset
        load breakfast-menu.sw
        apply-word |*> #=> |word:> __ |_self>
        remove-punctuation (*) #=> string-replace(|_self>, split[""] |:;.,!?$-"'>, |>)
        read |*> #=> apply-word ssplit[" "] to-lower remove-punctuation remove-prefix["text: "] |_self>
        active-buffer[7,0] read description |food: Homestyle Breakfast>
            |number: 2> . |food: eggs> . |food: bacon> . |> . |food: sausage> . |food: toast> . |> . |> . |> . |food: hash browns> . |>

        reset
        apply-word |*> #=> |word:> __ |_self>
        remove-punctuation (*) #=> string-replace(|_self>, split[""] |:;.,!?$-"'>, |>)
        read |*> #=> apply-word ssplit[" "] to-lower remove-punctuation remove-prefix["text: "] |_self>
        load active-buffer-example.sw

        active-buffer[7,0] read |text: Hey Freddie what's up?>
            |greeting: Hey!> . 0.25|person: Fred Smith> . |> . |direction: up> + 0.333|phrase: up the duff>
            
        active-buffer[7,0] read |text: Hey Mazza, you with child, up the duff, in the family way, having a baby?>
            |greeting: Hey!> . |person: Mary> . |> . |phrase: with child> . |> . |direction: up> + |phrase: up the duff> + 0.25|phrase: in the family way> . |> . |> . |phrase: in the family way> + 0.333|phrase: up the duff> . |> . |> . |> . |phrase: having a baby> . |> . |>

        active-buffer[7,0] active-buffer[7,0] read |text: Hey Mazza, you with child, up the duff, in the family way, having a baby?>
            |> . |> . |> . 0.25|concept: pregnancy> . |> . 0.361|concept: pregnancy> . |> . |> . 0.5|concept: pregnancy> . |> . |> . |> . 0.25|concept: pregnancy> . |> . |>

    see also:
        explain

Home