<commit_before>#!/usr/bin/env perl
package Interhack::Plugin::InGame::PasteDetection;
use Calf::Role;
use Term::ReadKey;

our $VERSION = '1.99_01';

# deps {{{
sub depend { 'Util' }
# }}}
# attributes {{{
has paste_queue => (
    per_load => 1,
    isa => 'Str',
    lazy => 1,
    default => sub { '' },
);
# }}}
# method modifiers {{{
around 'from_user' => sub
{
    my $orig = shift;
    my ($self) = @_;

    if (length $self->paste_queue)
    {
        my $c = substr($self->paste_queue, 0, 1);
        $self->paste_queue(substr($self->paste_queue, 1));
        return $c;<commit_msg>Add a comment abou the genesis of the paste detection plugin :)<commit_after>#!/usr/bin/env perl
package Interhack::Plugin::InGame::PasteDetection;
use Calf::Role;
use Term::ReadKey;

our $VERSION = '1.99_01';

# Sun May 06 2007
# [20:55:13] <doy> Eidolos: maybe somehow detect accidental pastes into the nh window?
# [20:55:21] <toft> good idea
# [20:55:23] <toft> irssi does it
# [20:55:24] <doy> would probably be hard to do that though
# [21:00:08] <Eidolos> can anyone think of anything else for this helper?
# [21:00:37] <doy> Eidolos: scroll up
# [21:00:47] <Eidolos> oh, the paste detection? meh
# [21:00:52] <Eidolos> no way I could code that! :)

# deps {{{
sub depend { 'Util' }
# }}}
# attributes {{{
has paste_queue => (
    per_load => 1,
    isa => 'Str',
    lazy => 1,
    default => sub { '' },
);
# }}}
# method modifiers {{{
around 'from_user' => sub
{
    my $orig = shift;
    my ($self) = @_;

    if (length $self->paste_queue)
    {
        my $c = substr($self->paste_queue, 0, 1);
        $self->paste_queue(substr($self->paste_queue, 1));
        return $c;
{'fraction_non_alphanumeric': 0.1816009557945042, 'fraction_numerical': 0.04420549581839905, 'mean_word_length': 3.442970822281167, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 31, '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': '3861327', 'n_tokens_mistral': 693, 'n_tokens_neox': 633, 'n_words': 172}