bugfix for applying base regularization
Tara L Andrews [Fri, 28 Sep 2012 10:48:00 +0000 (12:48 +0200)]
morphology/lib/Text/Tradition/Morphology.pm

index e3cdc5c..fc59bd9 100644 (file)
@@ -189,7 +189,10 @@ sub regularize {
                my $mod = 'Text::Tradition::Language::' . $self->language;
                eval { load( $mod ); };
                # If a module doesn't exist for our language, use the base routine
-               $mod = 'Text::Tradition::Language::Base' if $@;
+               if( $@ ) {
+                       $mod = 'Text::Tradition::Language::Base';
+                       load( $mod );
+               }
                return $mod->can( 'regularize' )->( $self->text );
        } else {
                return $self->text;