Models the Gold Paradigm.

Example

Imports

import cats.implicits._
import spire.implicits._
import axle._
import axle.lx._
import Gold._

Setup

val mHi = Morpheme("hi")
val mIm = Morpheme("I'm")
val mYour = Morpheme("your")
val mMother = Morpheme("Mother")
val mShut = Morpheme("shut")
val mUp = Morpheme("up")

val Σ = Vocabulary(Set(mHi, mIm, mYour, mMother, mShut, mUp))

val s1 = mHi :: mIm :: mYour :: mMother :: Nil
val s2 = mShut :: mUp :: Nil

val  = Language(Set(s1, s2))

val T = Text(s1 ::  ::  :: s2 ::  :: s2 :: s2 :: Nil)

val ɸ = MemorizingLearner()

Usage

ɸ.guesses(T).
 find(_. === ).
 map(finalGuess => "well done, ɸ").
 getOrElse("ɸ never made a correct guess")
// res5: String = ɸ never made a correct guess


// res6: axle.lx.Gold.Language = Language(Set(List(Morpheme(hi), Morpheme(I'm), Morpheme(your), Morpheme(Mother)), List(Morpheme(shut), Morpheme(up))))

T
// res7: axle.lx.Gold.Text = Text(List(List(Morpheme(hi), Morpheme(I'm), Morpheme(your), Morpheme(Mother)), List(), List(), List(Morpheme(shut), Morpheme(up)), List(), List(Morpheme(shut), Morpheme(up)), List(Morpheme(shut), Morpheme(up))))

T.isFor()
// res8: Boolean = true