Packages

case class Lexicon(vocabularySize: Int, contextSize: Int, data: Vector[Double], speakerDefinition: (Lexicon, Int) ⇒ Lexicon = Lexicon.asBlokpoeletalSpeaker, listenerDefinition: (Lexicon, Int) ⇒ Lexicon = Lexicon.asBlokpoelEtalListener) extends Serializable with Product

A lexicon as defined in the Rational Speech Act theory (Frank & Goodman, 2012). This implementation supports both binary and graded lexicons. It also implements functions that constitute the Rational Speech Act model, i.e., to compute n-th order lexicons. The relationships between vocabulary and context are stored in a 1-dimensional vector. The following mapping:

R1

R2

R3

S1

0.8

0.2

0.0

S2

0.0

0.6

0.4

Is represented in data as a concatenation of the rows or length contextSize:

Vector[Double](0.8, 0.2, 0.0, 0.0, 0.6, 0.4)

Lexicons are immutable.

vocabularySize

The size of the vocabulary of this lexicon.

contextSize

The size of the context of this lexicon.

data

A 1-dimensional vector representing the relations between the vocabulary and context.

Annotations
@SerialVersionUID()
Linear Supertypes
Known Subclasses
Type Hierarchy
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Lexicon
  2. Product
  3. Equals
  4. Serializable
  5. Serializable
  6. AnyRef
  7. Any
Implicitly
  1. by any2stringadd
  2. by StringFormat
  3. by Ensuring
  4. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Lexicon(vocabularySize: Int, contextSize: Int, data: Vector[Double], speakerDefinition: (Lexicon, Int) ⇒ Lexicon = Lexicon.asBlokpoeletalSpeaker, listenerDefinition: (Lexicon, Int) ⇒ Lexicon = Lexicon.asBlokpoelEtalListener)

    vocabularySize

    The size of the vocabulary of this lexicon.

    contextSize

    The size of the context of this lexicon.

    data

    A 1-dimensional vector representing the relations between the vocabulary and context.

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. def +(other: String): String
    Implicit
    This member is added by an implicit conversion from Lexicon to any2stringadd[Lexicon] performed by method any2stringadd in scala.Predef.
    Definition Classes
    any2stringadd
  4. def ->[B](y: B): (Lexicon, B)
    Implicit
    This member is added by an implicit conversion from Lexicon to ArrowAssoc[Lexicon] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  5. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  6. def additiveBinaryMutation(additionRate: Double): Lexicon

    Returns a copy of this lexicon where, based on additionRate, a number of positive signal-referent relations of weight 1.0 will be added to the lexicon.

    Returns a copy of this lexicon where, based on additionRate, a number of positive signal-referent relations of weight 1.0 will be added to the lexicon.

    additionRate

    The ratio of 0-valued signal-referent mappings that will be converted to 1.0 (from 0 to 1).

  7. def apply(i: Int, j: Int): Double

    Returns the relation value for signal i and referent j.

    Returns the relation value for signal i and referent j.

    i

    Index of the signal.

    j

    Index of the referent.

  8. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  9. def asymmetryWith(that: Lexicon, similarity: Double = 0): Double

    Returns the asymmetry between this lexicon and that lexicon.

    Returns the asymmetry between this lexicon and that lexicon. Asymmetry is computed relative to the similarity threshold, i.e., it is the mean number of signal-referent relations that are more than similarity-value apart.

    that

    The other lexicon against which asymmetry is computed.

    similarity

    Optional argument specifying the threshold within which a signal-referent relation is considered 'same'.

    returns

    The asymmetry between this and that.

  10. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  11. val contextSize: Int
  12. val data: Vector[Double]
  13. def dot(vector: Vector[Double]): Vector[Double]

    Computes the dot product between the graded lexicon and a vector of length contextSize.

    Computes the dot product between the graded lexicon and a vector of length contextSize.

    vector

    A vector of length contextSize.

    returns

    A vector of length vocabularySize with the dot product.

    Exceptions thrown

    scala.IllegalArgumentException when vector.length is not equal to contextSize of this lexicon.

  14. def dotT(vector: Vector[Double]): Vector[Double]

    Computes the dot product between the transposed graded lexicon and a vector of vocabularySize.

    Computes the dot product between the transposed graded lexicon and a vector of vocabularySize.

    vector

    A vector of length vocabularySize.

    returns

    A vector of length contextSize with the dot product.

    Exceptions thrown

    scala.IllegalArgumentException when vector.length is not equal to vocabularySize of this lexicon.

  15. def ensuring(cond: (Lexicon) ⇒ Boolean, msg: ⇒ Any): Lexicon
    Implicit
    This member is added by an implicit conversion from Lexicon to Ensuring[Lexicon] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  16. def ensuring(cond: (Lexicon) ⇒ Boolean): Lexicon
    Implicit
    This member is added by an implicit conversion from Lexicon to Ensuring[Lexicon] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  17. def ensuring(cond: Boolean, msg: ⇒ Any): Lexicon
    Implicit
    This member is added by an implicit conversion from Lexicon to Ensuring[Lexicon] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  18. def ensuring(cond: Boolean): Lexicon
    Implicit
    This member is added by an implicit conversion from Lexicon to Ensuring[Lexicon] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  19. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  20. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  21. def formatted(fmtstr: String): String
    Implicit
    This member is added by an implicit conversion from Lexicon to StringFormat[Lexicon] performed by method StringFormat in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @inline()
  22. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  23. def getColumn(j: Int): Vector[Double]

    Returns the column for referent j, containing all mapping values between referent j and all signals.

    Returns the column for referent j, containing all mapping values between referent j and all signals. This function is of quadratic time complexity, use sparingly.

  24. def getRow(i: Int): Vector[Double]

    Returns the row for signal i, containing all mapping values between signal i and all referents.

  25. def isConsistent: Boolean
  26. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  27. val listenerDefinition: (Lexicon, Int) ⇒ Lexicon
  28. def meanAmbiguity(threshold: Double = 1): Double

    Returns the mean ambiguity of this graded lexicon, where ambiguity is defined as the mean number of referents for which signals have a relation higher than the threshold.

    Returns the mean ambiguity of this graded lexicon, where ambiguity is defined as the mean number of referents for which signals have a relation higher than the threshold.

    threshold

    Optional parameter specifying the threshold within which a signal-referent relation is considered relevant.

  29. def meanAndVarianceAmbiguity(threshold: Double = 1): (Double, Double)

    Returns a tuple containing the mean (._1) and variance (._2) ambiguity of this graded lexicon.

    Returns a tuple containing the mean (._1) and variance (._2) ambiguity of this graded lexicon. Ambiguity is defined as the mean number of referents for which signals have a relation higher than the threshold.

    threshold

    Optional parameter specifying the threshold within which a signal-referent relation is considered relevant.

  30. def mixReferents(mixRate: Double): Lexicon

    Returns an immutable copy of this lexicon where, based on the swapRate, signal-referent relations are swapped around with across the mapping's central axis.

    Returns an immutable copy of this lexicon where, based on the swapRate, signal-referent relations are swapped around with across the mapping's central axis. That is, if swapped, (i)(j) and (i)(contextSize - j) are swapped.

    mixRate

    The rate at which referents are swapped.

    returns

    A referent-swapped signal-referent mapping.

  31. def mutate(mutationRate: Double): Lexicon

    Returns a mutated (but immutable) copy of this lexicon.

    Returns a mutated (but immutable) copy of this lexicon. Each word-referent relationship with graded value v has probability P(mutationRate) of flipping according to Math.abs(v-1). In binary lexicons, a 1 flips to a 0 and vice versa. In graded lexicons a 0.9 flips to a 0.1 and vice versa. This is a non-deterministic transformation.

    mutationRate

    The probability of a word-referent mapping flipping.

    returns

    A mutated (but immutable) mapping.

  32. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  33. def normalizeColumns(): Lexicon

    Returns a normalization of this lexicon across columns (i.e., divides each cell by the sum of its column).

  34. def normalizeRows(): Lexicon

    Returns a normalization of this lexicon across rows (i.e., divides each cell by the sum of its row).

  35. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  36. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  37. def removalBinaryMutation(removalRate: Double, threshold: Double = 1): Lexicon

    Returns a copy of this lexicon where, based on additionRate, a number signal-referent relations of weight > threshold will be removed to the lexicon.

    Returns a copy of this lexicon where, based on additionRate, a number signal-referent relations of weight > threshold will be removed to the lexicon.

    removalRate

    The ratio of 0-valued signal-referent mappings that will be converted to 1.0 (from 0 to 1).

    threshold

    Optional parameter specifying the threshold above which relations can be removed.

  38. def setOrderAsListener(n: Int): Lexicon

    Returns a transformation of this lexicon corresponding to a nth order listener as defined by the Rational Speech Act model.

    Returns a transformation of this lexicon corresponding to a nth order listener as defined by the Rational Speech Act model.

    n

    The order of pragmatic reasoning.

  39. def setOrderAsSpeaker(n: Int): Lexicon

    Returns a transformation of this lexicon corresponding to a nth order speaker as defined by the Rational Speech Act model.

    Returns a transformation of this lexicon corresponding to a nth order speaker as defined by the Rational Speech Act model.

    n

    The order of pragmatic reasoning.

  40. val speakerDefinition: (Lexicon, Int) ⇒ Lexicon
  41. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  42. def to2DVector: Vector[Vector[Double]]

    Returns a 2-dimensional vector representation of the lexicon.

    Returns a 2-dimensional vector representation of the lexicon. Inefficient function, avoid usage.

  43. def toString(): String

    Returns a multi-line formatted string representation of the lexicon.

    Returns a multi-line formatted string representation of the lexicon.

    Definition Classes
    Lexicon → AnyRef → Any
  44. def update(i: Int, j: Int, v: Double): Lexicon

    Returns a new immutable lexicon with the relation between signal i and referent j updated to value v.

  45. val vocabularySize: Int
  46. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  47. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  48. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  49. def [B](y: B): (Lexicon, B)
    Implicit
    This member is added by an implicit conversion from Lexicon to ArrowAssoc[Lexicon] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc

Inherited from Product

Inherited from Equals

Inherited from Serializable

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Inherited by implicit conversion any2stringadd from Lexicon to any2stringadd[Lexicon]

Inherited by implicit conversion StringFormat from Lexicon to StringFormat[Lexicon]

Inherited by implicit conversion Ensuring from Lexicon to Ensuring[Lexicon]

Inherited by implicit conversion ArrowAssoc from Lexicon to ArrowAssoc[Lexicon]

Ungrouped