/* This is -*- C -*- */
/* vim: set sw=2: */
/* $Id$ */

/*
 * seqmodel.h
 *
 * Copyright (C) 2003 The Free Software Foundation, Inc.
 *
 * Developed by Jon Trowbridge <trow@gnu.org>
 */

/*
 * 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 2 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, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
 * USA.
 */

#ifndef __SEQMODEL_H__
#define __SEQMODEL_H__

#include <glib.h>
#include <Python.h>

typedef gpointer  SeqAtom;

typedef gboolean (*SeqAtomEq)    (SeqAtom a, SeqAtom b);
typedef guint    (*SeqAtomHash)  (SeqAtom a);
typedef void     (*SeqAtomRef)   (SeqAtom a);
typedef void     (*SeqAtomUnref) (SeqAtom a);

typedef struct _SeqModel SeqModel;
struct _SeqModel {

  unsigned N;

  SeqAtom      padding_atom;
  SeqAtom      wildcard_atom;
  SeqAtomEq    atom_eq;
  SeqAtomHash  atom_hash;
  SeqAtomRef   atom_ref;
  SeqAtomUnref atom_unref;

  GHashTable  *tree;

};

SeqModel *seq_model_new (unsigned     N,
			 SeqAtom      padding_atom,
			 SeqAtom      wildcard_atom,
			 SeqAtomEq    atom_eq,
			 SeqAtomHash  atom_hash,
			 SeqAtomRef   atom_ref,
			 SeqAtomUnref atom_unref);

void seq_model_free (SeqModel *model);

void seq_model_add_sentence (SeqModel *model,
			     SeqAtom  *sentence,
			     unsigned  len);

/* Python Extensions */

PyObject *seq_model_to_py   (SeqModel *model);
SeqModel *seq_model_from_py (PyObject *py_model);

PyObject *py_seq_model_new (PyObject *self, PyObject *args);

#endif /* __SEQMODEL_H__ */

