1#!/usr/bin/env python2.7
2# ----------------------------------
3#
4# Usage: join_feature_class.py <class-file> <feature-file>
5#
6# Read class assignment file and feature file and return a file of
7# problem names with features and class.
8#
9# Copyright 2003 Stephan Schulz, schulz@informatik.tu-muenchen.de
10#
11# This code is part of the support structure for the equational
12# theorem prover E. Visit
13#
14#  http://www4.informatik.tu-muenchen.de/~schulz/WORK/eprover.html
15#
16# for more information.
17#
18# This program is free software; you can redistribute it and/or modify
19# it under the terms of the GNU General Public License as published by
20# the Free Software Foundation; either version 2 of the License, or
21# (at your option) any later version.
22#
23# This program is distributed in the hope that it will be useful,
24# but WITHOUT ANY WARRANTY; without even the implied warranty of
25# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
26# GNU General Public License for more details.
27#
28# You should have received a copy of the GNU General Public License
29# along with this program ; if not, write to the Free Software
30# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
31# MA  02111-1307 USA
32#
33# The original copyright holder can be contacted as
34#
35# Stephan Schulz (I4)
36# Technische Universitaet Muenchen
37# Institut fuer Informatik
38# Boltzmannstrasse 3
39# Garching bei Muenchen
40# Germany
41#
42# or via email (address above).
43
44import sys
45import string
46
47import pylib_io
48import pylib_eprots
49
50pylib_io.check_argc(2)
51
52cl = pylib_eprots.classification()
53cl.parse(sys.argv[1])
54
55fl = pylib_eprots.featurelist()
56fl.parse(sys.argv[2])
57
58for i in fl:
59    try:
60        tclass = cl.classify(i[0])
61        print i[0],":", string.join(i[1],","),":",tclass
62    except KeyError:
63        pass
64