<commit_before>use strict;
use warnings;

package Qublog::Web::Emoticon;
use base qw( Text::Emoticon );

use Qublog::Web;

=head1 NAME

Qublog::Web::Emoticon - emoticons for Qublog

=head1 SYNOPSIS

  my $filter = Qublog::Web::Emoticon->new;
  print $filter->filter('Hello :^)');

=head1 DESCRIPTION

Defines the emoticons used by Qublog.

=head2 EMOTICONS

The following emoticons are supported.

  :S :-S :^S o_O O_o 
  :'( :'-( :'^( T_T 
  8) 8-) 8^) 
  >:) >:-) >:^)
  :D :-D :^D 
  XD X-D X^D
  X[ X-[ X^[ 
  :| :-| :^| :/ :-/ :^/
  :p :-p :^P :P :-P :^P 
  :$ :-$ :^$ 
  /:| /:-| /:^| 
  :( :-( :^( v_v 
  :) :-) :^) ^_^ 
  :o :-o :^o :O :-O :^O 
  >:D >:-D >:^D 
  ;) ;-) ;^) ^_~ ~_^ 
  XO X-O X^O 

=cut

my %icons = (
    confuse  => [ qw{ :S :-S :^S o_O O_o } ],
    cry      => [ qw{ :'( :'-( :'^( T_T } ],
    cool     => [ qw{ 8) 8-) 8^) } ],
    evil     => [ qw{ >:) >:-) >:^) } ],
    grin     => [ qw{ :D :-D :^D } ],
    lol      => [ qw{ XD X-D X^D } ],
    mad      => [ qw{ X[ X-[ X^[ } ],
    neutral  => [ qw{ :| :-| :^| :/ :-/ :^/ } ],
    razz     => [ qw{ :p :-p :^P :P :-P :^P } ],
    red      => [ qw{ :$ :-$ :^$ } ],
    roll     => [ qw{ /:| /:-| /:^| } ],
    sad      => [ qw{ :( :-( :^( v_v } ],
    smiley   => [ qw{ :) :-) :^) ^_^ } ],
    surprise => [ qw{ :o :-o :^o :O :-O :^O } ],
    twist    => [ qw{ >:D >:-D >:^D } ],
    wink     => [ qw{ ;) ;-) ;^) ^_~ ~_^ } ],
    yell     => [ qw{ XO X-O X^O } ],
);

my %smileys;
while (my ($icon, $smileys) = each %icons) {
    for my $smiley (@$smileys) {
        $smileys{ $smiley } = 'smiley-' . $icon . '.png';
    }
}

__PACKAGE__->register_subclass(\%smileys);

sub default_config {
    return {
        imgbase => '/images/icons',
        xhtml   => 1,
        class   => 'smiley',
    };
}

sub filter {
    my($self, $text) = @_;
    return unless defined $text;<commit_msg>Correcting the path for emoticons in the Qublog catalyst port<commit_after>use strict;
use warnings;

package Qublog::Web::Emoticon;
use base qw( Text::Emoticon );

use Qublog::Web;

=head1 NAME

Qublog::Web::Emoticon - emoticons for Qublog

=head1 SYNOPSIS

  my $filter = Qublog::Web::Emoticon->new;
  print $filter->filter('Hello :^)');

=head1 DESCRIPTION

Defines the emoticons used by Qublog.

=head2 EMOTICONS

The following emoticons are supported.

  :S :-S :^S o_O O_o 
  :'( :'-( :'^( T_T 
  8) 8-) 8^) 
  >:) >:-) >:^)
  :D :-D :^D 
  XD X-D X^D
  X[ X-[ X^[ 
  :| :-| :^| :/ :-/ :^/
  :p :-p :^P :P :-P :^P 
  :$ :-$ :^$ 
  /:| /:-| /:^| 
  :( :-( :^( v_v 
  :) :-) :^) ^_^ 
  :o :-o :^o :O :-O :^O 
  >:D >:-D >:^D 
  ;) ;-) ;^) ^_~ ~_^ 
  XO X-O X^O 

=cut

my %icons = (
    confuse  => [ qw{ :S :-S :^S o_O O_o } ],
    cry      => [ qw{ :'( :'-( :'^( T_T } ],
    cool     => [ qw{ 8) 8-) 8^) } ],
    evil     => [ qw{ >:) >:-) >:^) } ],
    grin     => [ qw{ :D :-D :^D } ],
    lol      => [ qw{ XD X-D X^D } ],
    mad      => [ qw{ X[ X-[ X^[ } ],
    neutral  => [ qw{ :| :-| :^| :/ :-/ :^/ } ],
    razz     => [ qw{ :p :-p :^P :P :-P :^P } ],
    red      => [ qw{ :$ :-$ :^$ } ],
    roll     => [ qw{ /:| /:-| /:^| } ],
    sad      => [ qw{ :( :-( :^( v_v } ],
    smiley   => [ qw{ :) :-) :^) ^_^ } ],
    surprise => [ qw{ :o :-o :^o :O :-O :^O } ],
    twist    => [ qw{ >:D >:-D >:^D } ],
    wink     => [ qw{ ;) ;-) ;^) ^_~ ~_^ } ],
    yell     => [ qw{ XO X-O X^O } ],
);

my %smileys;
while (my ($icon, $smileys) = each %icons) {
    for my $smiley (@$smileys) {
        $smileys{ $smiley } = 'smiley-' . $icon . '.png';
    }
}

__PACKAGE__->register_subclass(\%smileys);

sub default_config {
    if ($Jifty::VERSION) {
        return {
            imgbase => '/images/icons',
            xhtml   => 1,
            class   => 'smiley',
        };
    }
    else {
        return {
            imgbase => '/static/images/icons',
            xhtml   => 1,
            class   => 'smiley',
        };
    }
}

sub filter {
    my($self, $text) = @_;
    return unless defined $text;
{'fraction_non_alphanumeric': 0.2704465629703964, 'fraction_numerical': 0.00577019568489714, 'mean_word_length': 1.7572614107883817, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 76, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6508821', 'n_tokens_mistral': 1940, 'n_tokens_neox': 1807, 'n_words': 390}