Documentation

Linglib.Data.Examples.Schema

Data from examples #

This file defines the data a study reads off a paper's examples; the lookups a study makes on them are in Data/Examples/Readers.lean. An example is what the paper prints under a number; a Datum is one piece of data the paper reports with it in the sense of Tonhauser and Matthewson: an expression (the example, or one alternant of it), the context it is judged in, and the judgment, less the information about the speakers that papers seldom give. A datum is a row of the Examples component of the Cross-Linguistic Data Formats of Forkel et al., in version 1.3, and the sentence-level counterpart of Data/Wordlist/.

Main definitions #

Implementation notes #

TODO #

References #

@[reducible, inline]

A Glottolog language identifier, such as "stan1293" for Standard English.

Equations
Instances For
    structure SourceRef :

    A SourceRef is a CLDF source reference bibkey[locator] with its two parts kept apart.

    • bibkey : String

      The key of the paper's entry in references.bib.

    • paperLabel : String

      The locator in the paper: its example number, table or page.

    Instances For
      def instDecidableEqSourceRef.decEq (x✝ x✝¹ : SourceRef) :
      Decidable (x✝ = x✝¹)
      Equations
      • instDecidableEqSourceRef.decEq { bibkey := a, paperLabel := a_1 } { bibkey := b, paperLabel := b_1 } = if h : a = b then h ▸ if h : a_1 = b_1 then h ▸ isTrue ⋯ else isFalse ⋯ else isFalse ⋯
      Instances For
        def instReprSourceRef.repr :
        SourceRef → ℕ → Std.Format
        Equations
        • One or more equations did not get rendered due to their size.
        Instances For
          @[instance_reducible]
          Equations
          inductive Datum.Method :

          How an example and its judgment were obtained.

          • introspection : Method

            Constructed and judged by the author.

          • elicitation : Method

            Elicited from, or judged by, native-speaker consultants.

          • corpus : Method

            Attested in a text, a corpus or on the web.

          • experiment : Method

            A stimulus whose judgment an experiment measured.

          • description : Method

            Cited from a grammar or dictionary that does not say how it was obtained.

          Instances For
            @[instance_reducible]
            instance Datum.instDecidableEqMethod :
            DecidableEq Method
            Equations
            def Datum.instReprMethod.repr :
            Method → ℕ → Std.Format
            Equations
            Instances For
              @[instance_reducible]
              Equations
              structure Datum :

              A Datum is a piece of data a paper reports with one of its examples [TM16]: an expression of a language with its gloss, the context it is judged in, the judgment, the forms and readings the paper judges with it, and the paper's own classifications of it. It is the part of a row of a CLDF ExampleTable that theorems read.

              • id : String

                The ID column holds a stable identifier keyed to the paper, {authoryear}_{label}.

              • source : SourceRef

                The paper that introduced the example.

              • reportedIn : Option SourceRef

                The paper whose data file holds the row, when it only reports an example from source.

              • method : Option Method

                How the example and its judgment were obtained; none where that is not yet classified.

              • language : Glottocode

                The Language_ID column holds the Glottocode of the language of the expression; empty for a constructed string of no language.

              • primaryText : String

                The Primary_Text column holds the expression without judgment marks.

              • glossedTokens : List (String × String)

                The Analyzed_Word and Gloss columns paired, each word with its gloss; empty when the source gives no gloss.

              • context : String

                The scenario the source gives for the judgment; empty when it gives none.

              • judgment : Judgment

                The judgment the source reports for the expression in the context.

              • verdict : Option Bool

                The truth-value judgment the source reports, where the task is truth in the context rather than the acceptability that judgment records; none where the source reports none.

              • alternatives : List (String × Judgment)

                The other forms the source judges in the same frame, each a whole sentence, with their judgments.

              • readings : List (String × Judgment)

                The readings the source distinguishes for the expression, each with its judgment.

              • paperFeatures : List (String × String)

                The paper's own columns, as key-value pairs.

              Instances For
                @[instance_reducible]
                instance instDecidableEqDatum :
                DecidableEq Datum
                Equations
                def instDecidableEqDatum.decEq (x✝ x✝¹ : Datum) :
                Decidable (x✝ = x✝¹)
                Equations
                • One or more equations did not get rendered due to their size.
                Instances For
                  def instReprDatum.repr :
                  Datum → ℕ → Std.Format
                  Equations
                  • One or more equations did not get rendered due to their size.
                  Instances For
                    @[instance_reducible]
                    instance instReprDatum :
                    Repr Datum
                    Equations