package scharpa
- Alphabetic
- By Inheritance
- scharpa
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
-
sealed
trait
Arc
extends AnyRef
Arcs are entries in the chart.
Arcs are entries in the chart. Each arc: - may be active (incomplete) or passive (complete); - has a start and end index, describing the span of covered words; - has a symbol, descibing the left-hand-side of the applied rule - may be extended by applying the fundamental rule (if certain conditions are met)
- trait BFBUChartParser extends BottomUpChartParser with BreadthFirstChartParser
-
trait
BottomUpChartParser
extends ChartParser
Starts with words and proceeds to find covering rules until it reaches the TOP symbol.
-
trait
BreadthFirstChartParser
extends ChartParser
Breadth-first - it's a queue *
- case class Chart (arcs: Set[Arc], sentence: Seq[String]) extends Product with Serializable
-
trait
ChartParser
extends AnyRef
Basic Chart parser, leaving abstract the methods for defining agenda extension.
- trait DFTDChartParser extends TopDownChartParser with DepthFirstChartParser
-
trait
DepthFirstChartParser
extends ChartParser
Depth-first - it's a stack *
-
case class
Grammar
(ruleset: Set[Rule], top: TopRule, generators: Set[RuleGenerator] = Set.empty[RuleGenerator]) extends Product with Serializable
A grammar is a set of rules, with an optional Top rule (for top-down traversal) *
- trait HasNextSymbol extends AnyRef
- trait HasRHS extends HasNextSymbol
- case class Leaf (symbol: String) extends Sym with Product with Serializable
- case class NonTerm (symbol: Symbol) extends Sym with Product with Serializable
- case class ParserState (agenda: Seq[Arc], chart: Chart) extends Product with Serializable
-
case class
RegexRuleGenerator
(lhs: NonTerm, regex: String) extends RuleGenerator with Product with Serializable
Simple RuleGenerator based on a regular expression, which, if it matches, generates a SimpleRule with a given LHS and the matching Sym as the sole RHS member.
- sealed trait Rule extends HasRHS
-
case class
RuleApplication
(rule: Rule, subarcs: Seq[Arc] = Seq.empty[Arc], applied: Int = 0) extends HasRHS with Product with Serializable
The application of a rule.
The application of a rule. Wraps the rule up with a tracking index to count how many symbols from the RHS have been successfully applied already.
- case class RuleArc (start: Int, end: Int, rule: RuleApplication) extends Arc with HasRHS with Product with Serializable
-
trait
RuleGenerator
extends HasNextSymbol
Generator for Rules from data, so the grammar can contain patterns for generating rules *
-
case class
SimpleRule
(lhs: NonTerm, rhsHead: Sym, rhsTail: Sym*) extends Rule with Product with Serializable
Rules are context-free grammar rules, which have a single left-hand-side entry, and expand to one or more right-hand-side entries (enforced by type).
- sealed trait Sym extends AnyRef
-
trait
TopDownChartParser
extends ChartParser
Starts with the TOP symbol, and proceeds to expand down to the words
-
case class
TopRule
(rhsOnly: NonTerm, topSymbol: NonTerm = 'ROOT) extends Rule with Product with Serializable
The TopRule is a single rule singled out as the topmost node of the grammar.
-
case class
WordArc
(start: Int, end: Int, symbol: Sym) extends Arc with Product with Serializable
WordArcs represent lexical entries added to the Chart.
WordArcs represent lexical entries added to the Chart. They hold no other structure, nor do they necessarily relate to grammar.