#
# <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 NodeInterface(object):
  """!
  Interface for node representation.
  
  Any implementation of this interface should implements the key(token) method.
  The aim is to convert the given token to token representation in the graph.
  """

  def __init__(self, tagset):
    """!
    Constructor sets given tages as a memger and makes the class as abstract
    
    @param: tagset Tagsed used while processing
    """
    # Tagset used in the document read process with type corpus2.Tagset
    self.tagset = tagset
    __metaclass__ = abc.ABCMeta

  @abc.abstractmethod
  def key(self, token):
    """!
    Abstract method which must be implemented by any child. 

    This method should converts the givem token to its representation into 
    graph. All possible node representations are available in grafon.node
    module. Returned value will be used as a node key into the built graph.
    This method must be always calling before adding the node to the graph!

    @param token: corpus2.Token which sould be converted to key
    @return Key for the token's node in any format/type
    """
    raise NotImplementedError("NodeInterface is an abstract class!")