summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/RiveScript.pm30
-rw-r--r--lib/RiveScript/WD.pm4
-rw-r--r--lib/RiveScript/demo/rpg.rive2
3 files changed, 18 insertions, 18 deletions
diff --git a/lib/RiveScript.pm b/lib/RiveScript.pm
index 2f72e94..222b4e8 100644
--- a/lib/RiveScript.pm
+++ b/lib/RiveScript.pm
@@ -1091,7 +1091,7 @@ sub sortReplies {
# values mean higher priority on the stack. Keep this in mind when
# keeping track of how to sort these things.
my $inherits = -1; # -1 means no {inherits} tag, for flexibility
- my $highest_inherits = -1; # highest inheritence # we've seen
+ my $highest_inherits = -1; # highest inheritance # we've seen
# Loop through and categorize these triggers.
my $track = {
@@ -1123,7 +1123,7 @@ sub sortReplies {
$inherits = -1;
}
- # If this is the first time we've seen this inheritence priority
+ # If this is the first time we've seen this inheritance priority
# level, initialize its structure.
if (!exists $track->{$inherits}) {
$track->{$inherits} = {
@@ -1430,7 +1430,7 @@ sub sortList {
return 1;
}
-# Given one topic, walk the inheritence tree and return an array of all topics.
+# Given one topic, walk the inheritance tree and return an array of all topics.
sub _getTopicTree {
my ($self,$topic,$depth) = @_;
@@ -1472,7 +1472,7 @@ sub _getTopicTree {
# Gather an array of all triggers in a topic. If the topic inherits other
# topics, recursively collect those triggers too. Take care about recursion.
sub _topicTriggers {
- my ($self,$topic,$triglvl,$depth,$inheritence,$inherited) = @_;
+ my ($self,$topic,$triglvl,$depth,$inheritance,$inherited) = @_;
# Break if we're in too deep.
if ($depth > $self->{depth}) {
@@ -1480,9 +1480,9 @@ sub _topicTriggers {
return ();
}
- # Important info about the depth vs inheritence params to this function:
+ # Important info about the depth vs inheritance params to this function:
# depth increments by 1 every time this function recursively calls itself.
- # inheritence increments by 1 only when this topic inherits another topic.
+ # inheritance increments by 1 only when this topic inherits another topic.
#
# This way, `> topic alpha includes beta inherits gamma` will have this effect:
# alpha and beta's triggers are combined together into one matching pool, and then
@@ -1492,7 +1492,7 @@ sub _topicTriggers {
# inherits other topics. This forces the {inherits} tag to be added to the
# triggers. This only applies when the top topic "includes" another topic.
- $self->debug ("\tCollecting trigger list for topic $topic (depth=$depth; inheritence=$inheritence; inherited=$inherited)");
+ $self->debug ("\tCollecting trigger list for topic $topic (depth=$depth; inheritance=$inheritance; inherited=$inherited)");
# topic: the name of the topic
# triglvl: either $self->{topics} or $self->{thats}
@@ -1506,7 +1506,7 @@ sub _topicTriggers {
# Check every included topic.
foreach my $includes (sort { $a cmp $b } keys %{$self->{includes}->{$topic}}) {
$self->debug ("\t\tTopic $topic includes $includes");
- push (@triggers, $self->_topicTriggers($includes,$triglvl,($depth + 1), $inheritence, 1));
+ push (@triggers, $self->_topicTriggers($includes,$triglvl,($depth + 1), $inheritance, 1));
}
}
@@ -1515,7 +1515,7 @@ sub _topicTriggers {
# Check every inherited topic.
foreach my $inherits (sort { $a cmp $b } keys %{$self->{lineage}->{$topic}}) {
$self->debug ("\t\tTopic $topic inherits $inherits");
- push (@triggers, $self->_topicTriggers($inherits,$triglvl,($depth + 1), ($inheritence + 1), 0));
+ push (@triggers, $self->_topicTriggers($inherits,$triglvl,($depth + 1), ($inheritance + 1), 0));
}
}
@@ -1525,8 +1525,8 @@ sub _topicTriggers {
if (exists $self->{lineage}->{$topic} || $inherited) {
my @inThisTopic = keys %{$triglvl->{$topic}};
foreach my $trigger (@inThisTopic) {
- $self->debug ("\t\tPrefixing trigger with {inherits=$inheritence}$trigger");
- push (@triggers, "{inherits=$inheritence}$trigger");
+ $self->debug ("\t\tPrefixing trigger with {inherits=$inheritance}$trigger");
+ push (@triggers, "{inherits=$inheritance}$trigger");
}
}
else {
@@ -1590,7 +1590,7 @@ The data structure returned from this will follow this format:
"include" => { # topic inclusion
"alpha" => [ "beta", "gamma" ], # > topic alpha includes beta gamma
},
- "inherit" => { # topic inheritence
+ "inherit" => { # topic inheritance
"alpha" => [ "delta" ], # > topic alpha inherits delta
}
}
@@ -2645,7 +2645,7 @@ sub _getreply {
$matched = $self->{topics}->{$topic}->{$trig};
}
else {
- # Our topic doesn't have this trigger. Check inheritence.
+ # Our topic doesn't have this trigger. Check inheritance.
$matched = $self->_findTriggerByInheritence ($topic,$trig,0);
}
@@ -2801,11 +2801,11 @@ sub _findTriggerByInheritence {
# sorted array, but the trigger doesn't exist under the topic of
# which the user currently belongs. It probably was a trigger
# inherited/included from another topic. This subroutine finds that out,
- # recursively, following the inheritence trail.
+ # recursively, following the inheritance trail.
# Take care to prevent infinite recursion.
if ($depth > $self->{depth}) {
- $self->issue("Deep recursion detected while following an inheritence trail (involving topic $topic and trigger $trig)");
+ $self->issue("Deep recursion detected while following an inheritance trail (involving topic $topic and trigger $trig)");
return undef;
}
diff --git a/lib/RiveScript/WD.pm b/lib/RiveScript/WD.pm
index 15bad65..c45a059 100644
--- a/lib/RiveScript/WD.pm
+++ b/lib/RiveScript/WD.pm
@@ -364,7 +364,7 @@ of triggers of the source topic I<and> any included topics, will have a
higher matching priority than the inherited topics.
See L<"Sorting +Triggers"> to see how triggers are sorted internally. The
-following example shows how includes and inheritence works:
+following example shows how includes and inheritance works:
// This is in the default "random" topic and catches all non-matching
// triggers.
@@ -402,7 +402,7 @@ C<*> trigger at the top, because that trigger belongs to the "C<random>"
topic, and they're not in that topic.
Now let's see how we can pair these topics up with includes and
-inheritence.
+inheritance.
> topic ab includes alpha
+ hello bot
diff --git a/lib/RiveScript/demo/rpg.rive b/lib/RiveScript/demo/rpg.rive
index aaeacf4..8c92cde 100644
--- a/lib/RiveScript/demo/rpg.rive
+++ b/lib/RiveScript/demo/rpg.rive
@@ -1,6 +1,6 @@
! version = 2.00
-// This file tests topic inclusions and inheritence:
+// This file tests topic inclusions and inheritance:
//
// includes: this means that the topic "includes" the triggers present
// in another topic. Matching triggers in the source and included