Christoph Berg 21 лет назад
Родитель
Сommit
33e3aa7bbe
2 измененных файлов с 6 добавлено и 4 удалено
  1. 2 2
      docs/Changelog
  2. 4 2
      modules/Pisg/Parser/Logfile.pm

+ 2 - 2
docs/Changelog

@@ -2,8 +2,8 @@ pisg (0.66) - ??
    Christoph:
    Christoph:
    * Features:
    * Features:
      + Finally added support for 'asian' smiles ^^ (requested by Christian
      + Finally added support for 'asian' smiles ^^ (requested by Christian
-       Garbs), improved the smiley regexps, and implemented new most used
-       smileys stats.
+       Garbs) and left-handed smiles (-8, improved the smiley regexps, and
+       implemented new most used smileys stats.
      + Complain about invalid -cfg options (closes SF tracker #1183072 by
      + Complain about invalid -cfg options (closes SF tracker #1183072 by
        nandmaster).
        nandmaster).
    * Cache:
    * Cache:

+ 4 - 2
modules/Pisg/Parser/Logfile.pm

@@ -396,15 +396,17 @@ sub _parse_file
                     }
                     }
 
 
                     # Who smiles the most?
                     # Who smiles the most?
+                    my $e = '[8;:=%]'; # eyes
+                    my $n = '[-oc*^]'; # nose
                     # smileys including asian-style (^^ ^_^' ^^; ^_____^ ^o^)
                     # smileys including asian-style (^^ ^_^' ^^; ^_____^ ^o^)
-                    if ($saying =~ /(>?[8;:=%]'?[-o*^][\)pPD\}\]>]|[;:]\)|\^[_o-]*\^[';])/o) {
+                    if ($saying =~ /(>?$e'?$n[\)pPD\}\]>]|[\(\{\[<]$n'?$e<?|[;:]\)|\([;:]|\^[_o-]*\^[';])/o) {
                         $stats->{smiles}{$nick}++;
                         $stats->{smiles}{$nick}++;
                         $stats->{smileys}{$1}++;
                         $stats->{smileys}{$1}++;
                         $stats->{smileynicks}{$1} = $nick;
                         $stats->{smileynicks}{$1} = $nick;
                     }
                     }
 
 
                     # asian frown: ;_;
                     # asian frown: ;_;
-                    if ($saying =~ /([8;:=%]'?[-o*^][\(\[\\\/\{|]|:\(|;_+;|T_+T|-[._]+-)/o and
+                    if ($saying =~ /($e'?$n[\(\[\\\/\{|]|[\)\]\\\/\}|]$n'?$e|[;:]\(|\):|;_+;|T_+T|-[._]+-)/o and
                         $saying !~ /\w+:\/\//o) {
                         $saying !~ /\w+:\/\//o) {
                         $stats->{frowns}{$nick}++;
                         $stats->{frowns}{$nick}++;
                         $stats->{smileys}{$1}++;
                         $stats->{smileys}{$1}++;