#
# <one line to give the library's name and an idea of what it does.>
# Copyright (C) 2014  <copyright holder> <email>
# 
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# 
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# 
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
# 
#

import abc

class FilterInterface(object):
  """!
  Filters the tokens on these which should be into graph and these which
  sould not be into the graph.
  """
  __metaclass__ = abc.ABCMeta
  
  def __init__(self, options):
    """!
    Constructor makes the class as abstract class

    @param options extra parameters read from the config file. Each filter
      that is interested in any additional attributes should handle this object
      by itself.
    @type options: dict(str: str)
    """
    pass

  @abc.abstractmethod
  def accept_token_as_node(self, token, tagset):
    """!
    Abstract method to check that a token should or should not be skipped.

    For a given token any implementation of this method should return 
    True or False value. True must be returned when the token should 
    be stored into graph as one of nodes and False should be returned in case
    when the token should not be into the graph.

    @param token: object of corpus2.Token
    @param tagset: object of corpus2.Tagset
    @return True if token should be skipped or False if not
    """
    raise NotImplementedError("FilterInterface is an abstract class!")