#This module is to handle different ways to preprocess comments and identifiers
package MyLibrary::Process;

use strict;
use warnings;

our $VERSION = '1.00';

use base 'Exporter';

our @EXPORT = qw(skip cleanSentence);

sub skip {
	my $sent = shift;
	return 1 if $sent =~ /^\</;#file name info starts with <
	return 1 if $sent =~ /http/;#delete some http links
	return 1 if $sent =~ /\*\//;
	return 1 if $sent =~ /\</;
	return 1 if $sent =~ /@/;
	return 1 if $sent =~ /\*/;
	return 1 if $sent =~ /--/;
	return 1 if $sent =~ /\{/;
	return 1 if $sent =~ /\}/;
	return 1 if $sent =~ /^\s*return/;
	return 1 if $sent =~ /\/\S+\//;
	
}

#clean sentences
sub cleanSentence{
	my $sent = shift;	
	$sent =~ s/\./ /g;
	$sent =~ s/[0-9]+/ /g;
	$sent =~ s/#|\(|\)/ /g;
	$sent =~ s/=|>|\?|!|:|\"|;|\/|\^|&|\~|\'|\]|\[/ /g;
	$sent =~ s/ \s+/ /g;
	return $sent;

} 
