]> git.donarmstrong.com Git - infobot.git/blobdiff - src/Factoids/Update.pl
added debugging info for '.,' and '.,' problems
[infobot.git] / src / Factoids / Update.pl
index 692d48dccbc3a7fa1169ac2218f69123c734f0ad..de5b83597b1ad83eeb3bc30e505d24d35ffba9f2 100644 (file)
@@ -70,6 +70,20 @@ sub update {
            if ($also_or) {                     # 'is also ||'.
                $rhs = $exists.' || '.$rhs;
            } else {
+#              if ($exists =~ s/\,\s*$/,  /) {
+               if ($exists =~ /\,\s*$/) {
+                   &DEBUG("current has trailing comma, just append as is");
+                   # $rhs =~ s/^\s+//;
+                   # $rhs = $exists." ".$rhs;  # keep comma.
+               }
+
+               if ($exists =~ /\.\s*$/) {
+                   &DEBUG("current has trailing period, just append as is with 2 WS");
+                   # $rhs =~ s/^\s+//;
+                   # use ucfirst();?
+                   # $rhs = $exists."  ".$rhs; # keep comma.
+               }
+
                if ($rhs =~ /^[A-Z]/) {
                    if ($rhs =~ /\w+\s*$/) {
                        &status("auto insert period to factoid.");