Index: TRAIN/ECArgs.h =================================================================== --- TRAIN/ECArgs.h (revision 28) +++ TRAIN/ECArgs.h (working copy) @@ -2,7 +2,7 @@ #ifndef ECARGS_H #define ECARGS_H -#include +#include #include "ECString.h" class ECArgs Index: TRAIN/Pst.h =================================================================== --- TRAIN/Pst.h (revision 28) +++ TRAIN/Pst.h (working copy) @@ -23,7 +23,7 @@ #ifndef PST_H #define PST_H -#include +#include #include "WordInfo.h" #include "Phegt.h" Index: TRAIN/EmpNums.C =================================================================== --- TRAIN/EmpNums.C (revision 28) +++ TRAIN/EmpNums.C (working copy) @@ -1,5 +1,6 @@ #include "EmpNums.h" #include "utils.h" +#include int whichEmpty(const ECString& emp) Index: TRAIN/InputTree.h =================================================================== --- TRAIN/InputTree.h (revision 28) +++ TRAIN/InputTree.h (working copy) @@ -2,7 +2,7 @@ #ifndef INPUTTREE_H #define INPUTTREE_H -#include +#include #include "ECString.h" #include "utils.h" Index: TRAIN/headFinder.C =================================================================== --- TRAIN/headFinder.C (revision 28) +++ TRAIN/headFinder.C (working copy) @@ -1,4 +1,4 @@ -#include +#include #include "headFinder.h" #include "Term.h" #include "InputTree.h" Index: TRAIN/Feature.h =================================================================== --- TRAIN/Feature.h (revision 28) +++ TRAIN/Feature.h (working copy) @@ -2,7 +2,7 @@ #define FEATUREFUNCTION_H #include "ECString.h" -#include +#include #include #define MAXNUMFS 35 Index: TRAIN/utils.h =================================================================== --- TRAIN/utils.h (revision 28) +++ TRAIN/utils.h (working copy) @@ -25,14 +25,13 @@ #define UTILS_H #include -#include -#include +#include +#include #include "ECString.h" void error(const char *s); void warn(const char *s); double ran(); -double log2(double n); char* toLower(const char* str, char* temp); ECString intToString(int i); Index: TRAIN/FeatureTree.C =================================================================== --- TRAIN/FeatureTree.C (revision 28) +++ TRAIN/FeatureTree.C (working copy) @@ -1,8 +1,9 @@ #include "FeatureTree.h" #include "ECString.h" -#include +#include #include "Feature.h" #include "math.h" +#include "stdlib.h" int FeatureTree::totParams = 0; FeatureTree* FeatureTree::roots_[15]; Index: TRAIN/Term.h =================================================================== --- TRAIN/Term.h (revision 28) +++ TRAIN/Term.h (working copy) @@ -3,11 +3,11 @@ #define TERM_H #include "ECString.h" -#include -#include +#include +#include #include -#include -#include +#include +#include class Term; Index: TRAIN/makefile =================================================================== --- TRAIN/makefile (revision 28) +++ TRAIN/makefile (working copy) @@ -1,8 +1,8 @@ -#CFLAGS=-I/pro/include/stl -I/opt/SUNWspro/SC4.2/ +#CXXFLAGS=-I/pro/include/stl -I/opt/SUNWspro/SC4.2/ .C.o: - g++-2.95 $(CFLAGS) -g -c $< + $(CXX) $(CXXFLAGS) -g -c $< RCOUNTS_OBJS = \ ECArgs.o \ @@ -23,7 +23,7 @@ rCounts: $(RCOUNTS_OBJS) - g++-2.95 -g $(CFLAGS) $(RCOUNTS_OBJS) -o rCounts + $(CXX) -g $(CXXFLAGS) $(RCOUNTS_OBJS) -o rCounts ISCALE_OBJS = \ ECArgs.o \ @@ -40,7 +40,7 @@ iScale: $(ISCALE_OBJS) - g++-2.95 $(CFLAGS) $(ISCALE_OBJS) -o iScale + $(CXX) $(CXXFLAGS) $(ISCALE_OBJS) -o iScale SELFEATS_OBJS = \ ECArgs.o \ @@ -58,7 +58,7 @@ selFeats: $(SELFEATS_OBJS) - g++-2.95 $(CFLAGS) $(SELFEATS_OBJS) -o selFeats + $(CXX) $(CXXFLAGS) $(SELFEATS_OBJS) -o selFeats TRAINRS_OBJS = \ @@ -81,7 +81,7 @@ trainRs: $(TRAINRS_OBJS) - g++-2.95 $(CFLAGS) $(TRAINRS_OBJS) -o trainRs + $(CXX) $(CXXFLAGS) $(TRAINRS_OBJS) -o trainRs LISTWORDS_OBJS = \ ECArgs.o \ @@ -94,7 +94,7 @@ listWords.o listWords: $(LISTWORDS_OBJS) - g++-2.95 $(LISTWORDS_OBJS) -o listWords + $(CXX) $(LISTWORDS_OBJS) -o listWords @@ -109,7 +109,7 @@ pSgT.o pSgT: $(PSGT_OBJS) - g++-2.95 $(PSGT_OBJS) -o pSgT + $(CXX) $(PSGT_OBJS) -o pSgT PTGNT_OBJS = \ @@ -124,7 +124,7 @@ pTgNt.o pTgNt: $(PTGNT_OBJS) - g++-2.95 $(PTGNT_OBJS) -o pTgNt + $(CXX) $(PTGNT_OBJS) -o pTgNt PUGT_OBJS = \ ECArgs.o \ @@ -139,6 +139,8 @@ pUgT.o pUgT: $(PUGT_OBJS) - g++-2.95 $(PUGT_OBJS) -o pUgT + $(CXX) $(PUGT_OBJS) -o pUgT all: rCounts iScale selFeats trainRs listWords pSgT pTgNt pUgT +clean: + rm -f *.o rCounts iScale selFeats trainRs listWords pSgT pTgNt pUgT Index: TRAIN/rCounts.C =================================================================== --- TRAIN/rCounts.C (revision 28) +++ TRAIN/rCounts.C (working copy) @@ -1,9 +1,9 @@ -#include +#include #include -#include +#include #include -#include +#include #include "ECArgs.h" #include "Feature.h" #include "FeatureTree.h" @@ -271,5 +271,5 @@ } cout << "Total params for " << conditionedType << " = " << FeatureTree::totParams << endl; - cout << "Done: " << (int)sbrk(0) << endl; + cout << "Done: " << reinterpret_cast(sbrk(0)) << endl; } Index: TRAIN/FeatureTree.h =================================================================== --- TRAIN/FeatureTree.h (revision 28) +++ TRAIN/FeatureTree.h (working copy) @@ -2,12 +2,12 @@ #ifndef FEATURETREE_H #define FEATURETREE_H -#include +#include #include -#include -#include +#include +#include #include "Feat.h" -#include +#include #include "Feature.h" class FeatureTree; Index: TRAIN/ECArgs.C =================================================================== --- TRAIN/ECArgs.C (revision 28) +++ TRAIN/ECArgs.C (working copy) @@ -3,8 +3,11 @@ #include #include #include "utils.h" -#include "algo.h" +#include +#include +using namespace std; + ECArgs:: ECArgs(int argc, char *argv[]) { Index: TRAIN/auxify.C =================================================================== --- TRAIN/auxify.C (revision 28) +++ TRAIN/auxify.C (working copy) @@ -1,9 +1,10 @@ #include "auxify.h" -#include +#include +#include #include "Term.h" #include "ECString.h" -char* suffixes[] = { +const char* suffixes[] = { "'VE", "'M", "'LL", @@ -13,7 +14,7 @@ 0 }; -char* auxgs[] = { +const char* auxgs[] = { "BEIN", "HAVING", "BEING", @@ -21,7 +22,7 @@ }; -char* auxs[] = { +const char* auxs[] = { "MAHT", "SHULD", "WILL", @@ -98,7 +99,7 @@ return false; } -char* verbs[] = { +const char* verbs[] = { "VB", "VBD", "VBG", Index: TRAIN/InputTree.C =================================================================== --- TRAIN/InputTree.C (revision 28) +++ TRAIN/InputTree.C (working copy) @@ -1,6 +1,6 @@ #include -#include -#include +#include +#include #include #include "InputTree.h" #include "headFinder.h" Index: TRAIN/Feature.C =================================================================== --- TRAIN/Feature.C (revision 28) +++ TRAIN/Feature.C (working copy) @@ -1,6 +1,7 @@ -#include -#include +#include +#include +#include #include "Feature.h" #include "ECString.h" Index: TRAIN/utils.C =================================================================== --- TRAIN/utils.C (revision 28) +++ TRAIN/utils.C (working copy) @@ -21,8 +21,9 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "utils.h" -#include -#include +#include +#include +#include #include #include #include @@ -72,18 +73,11 @@ return (rand() * 4.656612875245796E-10); } -double -log2(double n) -{ - static double nat_log_2 = log( 2.0 ); - return log( n )/ nat_log_2; -} - template T ith(int i, const list l) { - list::const_iterator li = l.begin(); + typename list::const_iterator li = l.begin(); for(int j = 0 ; j < i ; j++) { assert(li != l.end()); Index: example_sentence.sgml =================================================================== --- example_sentence.sgml (revision 28) +++ example_sentence.sgml (working copy) @@ -1 +1 @@ - He said . + For part-of-speech tags and phrasal categories , this depends on the language and treebank on which the parser was trained ( and was decided by the treebank producers not us ) . Index: parse.sh =================================================================== --- parse.sh (revision 28) +++ parse.sh (working copy) @@ -1,6 +1,6 @@ -#! /bin/csh +#! /bin/bash -if( $# != 1 ) then +if [ $# != 1 ] ; then echo Usage: parse.sh file echo " " @@ -8,10 +8,13 @@ else - unlimit stacksize + # Leonid Boytsov: I suspect that ulimit may not be allowed, + # i.e., there may be a system limit on the amount of stack + # If there is, check /etc/sysctl.conf or booting scripts. + ulimit -s unlimited parseIt/parseIt -l100 -T210 DATA_3.02/ $1 -endif +fi Index: parseIt/ChartBase.C =================================================================== --- parseIt/ChartBase.C (revision 28) +++ parseIt/ChartBase.C (working copy) @@ -1,6 +1,7 @@ #include "ChartBase.h" #include +#include #include "GotIter.h" const double ChartBase::badParse = -1.0L; Index: parseIt/auxify.C =================================================================== --- parseIt/auxify.C (revision 28) +++ parseIt/auxify.C (working copy) @@ -1,5 +1,5 @@ #include "auxify.h" -#include +#include #include "Term.h" #include "ECString.h" Index: parseIt/Feature.C =================================================================== --- parseIt/Feature.C (revision 28) +++ parseIt/Feature.C (working copy) @@ -1,6 +1,6 @@ -#include -#include +#include +#include #include "Feature.h" #include "ECString.h" #include "utils.h" Index: parseIt/FBinaryArray.h =================================================================== --- parseIt/FBinaryArray.h (revision 28) +++ parseIt/FBinaryArray.h (working copy) @@ -2,8 +2,8 @@ #ifndef FBINARYARRAY_H #define FBINARYARRAY_H -#include -#include +#include +#include class Feat; class FeatureTree; Index: parseIt/parseIt.C =================================================================== --- parseIt/parseIt.C (revision 28) +++ parseIt/parseIt.C (working copy) @@ -23,9 +23,10 @@ #include #include -#include -#include +#include +#include #include +#include #include #include "ewDciTokStrm.h" #include "Field.h" Index: parseIt/SentRep.C =================================================================== --- parseIt/SentRep.C (revision 28) +++ parseIt/SentRep.C (working copy) @@ -22,7 +22,7 @@ */ #include "SentRep.h" -#include +#include #include "utils.h" #include Index: parseIt/ewDciTokStrm.h =================================================================== --- parseIt/ewDciTokStrm.h (revision 28) +++ parseIt/ewDciTokStrm.h (working copy) @@ -24,7 +24,7 @@ #ifndef EWDCI_H #define EWDCI_H -#include +#include #include "ECString.h" /*** This is file /pro/dpg/usl/ew/dcitokstrm/ewDciTokStrm.h **** Index: parseIt/AnswerTree.h =================================================================== --- parseIt/AnswerTree.h (revision 28) +++ parseIt/AnswerTree.h (working copy) @@ -3,7 +3,7 @@ #define ANSWERTREE_H #include "Edge.h" -#include +#include #include "CntxArray.h" class AnswerTree; Index: parseIt/Feature.h =================================================================== --- parseIt/Feature.h (revision 28) +++ parseIt/Feature.h (working copy) @@ -2,7 +2,7 @@ #define FEATUREFUNCTION_H #include "ECString.h" -#include +#include #include #define MAXNUMFS 30 Index: parseIt/Wrd.h =================================================================== --- parseIt/Wrd.h (revision 28) +++ parseIt/Wrd.h (working copy) @@ -25,7 +25,7 @@ #define WRD_H #include "ECString.h" -#include +#include #include "ewDciTokStrm.h" class Wrd; Index: parseIt/BchartSm.C =================================================================== --- parseIt/BchartSm.C (revision 28) +++ parseIt/BchartSm.C (working copy) @@ -2,7 +2,9 @@ #include "Feature.h" #include "FeatureTree.h" #include "utils.h" +#include "string.h" #include "math.h" +#include "GotIter.h" #include using std::find; @@ -471,7 +473,7 @@ pHypgt(const ECString& shU, int t) { bool hyp = false; - char* hyppos = strpbrk(shU.c_str(), "-"); + const char* hyppos = strpbrk(shU.c_str(), "-"); if(hyppos) hyp = true; double phyp = pHhypgt(t); return hyp ? phyp : (1 - phyp); Index: parseIt/SentRep.h =================================================================== --- parseIt/SentRep.h (revision 28) +++ parseIt/SentRep.h (working copy) @@ -25,7 +25,7 @@ #define SENTREP_H #include "Wrd.h" -#include +#include #include "ewDciTokStrm.h" class SentRep Index: parseIt/makefile =================================================================== --- parseIt/makefile (revision 28) +++ parseIt/makefile (working copy) @@ -1,7 +1,7 @@ .C.o: - g++-2.95 $(CFLAGS) -O -c $< + $(CXX) $(CXXFLAGS) -O -c $< PARSEIT_OBJS = \ AnswerTree.o \ @@ -34,8 +34,11 @@ parseIt: $(PARSEIT_OBJS) - g++-2.95 $(CFLAGS) $(PARSEIT_OBJS) -o parseIt + $(CXX) $(CXXFLAGS) $(PARSEIT_OBJS) -o parseIt +clean: + rm -f *.o parseIt + REPARSEIT_OBJS = \ AnswerTree.o \ Bchart.o \ @@ -67,5 +70,5 @@ reparse: $(REPARSEIT_OBJS) - g++-2.95 $(CFLAGS) $(REPARSEIT_OBJS) -o reparse + $(CXX) $(CXXFLAGS) $(REPARSEIT_OBJS) -o reparse Index: parseIt/Item.C =================================================================== --- parseIt/Item.C (revision 28) +++ parseIt/Item.C (working copy) @@ -1,5 +1,5 @@ #include "Item.h" -#include +#include Item:: ~Item() Index: parseIt/Bchart.C =================================================================== --- parseIt/Bchart.C (revision 28) +++ parseIt/Bchart.C (working copy) @@ -1,7 +1,7 @@ #include "Bchart.h" #include -#include -#include +#include +#include #include "GotIter.h" #include "FeatureTree.h" Index: parseIt/Item.h =================================================================== --- parseIt/Item.h (revision 28) +++ parseIt/Item.h (working copy) @@ -4,8 +4,8 @@ #include "Wrd.h" #include "Edge.h" -#include -#include +#include +#include #include "AnswerTree.h" #include "CntxArray.h" Index: parseIt/ECArgs.C =================================================================== --- parseIt/ECArgs.C (revision 28) +++ parseIt/ECArgs.C (working copy) @@ -3,8 +3,11 @@ #include #include #include "utils.h" -#include "algo.h" +#include +#include +using namespace std; + ECArgs:: ECArgs(int argc, char *argv[]) { Index: parseIt/Edge.C =================================================================== --- parseIt/Edge.C (revision 28) +++ parseIt/Edge.C (working copy) @@ -2,11 +2,12 @@ #include "Edge.h" #include "Item.h" // need Item, Items definitions #include "GotIter.h" -#include +#include #include "Bchart.h" #include #include "Feature.h" +using namespace std; #define EDGE_CHUNKSIZE 1000 //int Edge::numEdges = 0; Index: parseIt/InputTree.C =================================================================== --- parseIt/InputTree.C (revision 28) +++ parseIt/InputTree.C (working copy) @@ -1,5 +1,5 @@ -#include -#include +#include +#include #include "InputTree.h" #include "headFinder.h" #include "utils.h" Index: parseIt/utils.C =================================================================== --- parseIt/utils.C (revision 28) +++ parseIt/utils.C (working copy) @@ -21,12 +21,13 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "utils.h" -#include -#include +#include +#include #include #include "ECString.h" #include #include +#include void error( const char *s ) @@ -84,7 +85,7 @@ T ith(int i, const list l) { - list::const_iterator li = l.begin(); + typename list::const_iterator li = l.begin(); for(int j = 0 ; j < i ; j++) { assert(li != l.end()); Index: parseIt/ECArgs.h =================================================================== --- parseIt/ECArgs.h (revision 28) +++ parseIt/ECArgs.h (working copy) @@ -2,7 +2,7 @@ #ifndef ECARGS_H #define ECARGS_H -#include +#include #include "ECString.h" class ECArgs Index: parseIt/CntxArray.C =================================================================== --- parseIt/CntxArray.C (revision 28) +++ parseIt/CntxArray.C (working copy) @@ -33,8 +33,8 @@ return 0; } -ostream& -operator<< ( ostream& os, const CntxArray& ca ) +std::ostream& +operator<< ( std::ostream& os, const CntxArray& ca ) { int i; int sz = ca.sz; Index: parseIt/InputTree.h =================================================================== --- parseIt/InputTree.h (revision 28) +++ parseIt/InputTree.h (working copy) @@ -2,7 +2,7 @@ #ifndef INPUTTREE_H #define INPUTTREE_H -#include +#include #include "ECString.h" #include "utils.h" #include "ParseStats.h" Index: parseIt/headFinder.C =================================================================== --- parseIt/headFinder.C (revision 28) +++ parseIt/headFinder.C (working copy) @@ -1,4 +1,4 @@ -#include +#include #include "headFinder.h" #include "Term.h" #include "InputTree.h" Index: parseIt/FullHist.h =================================================================== --- parseIt/FullHist.h (revision 28) +++ parseIt/FullHist.h (working copy) @@ -3,7 +3,7 @@ #define FULLHIST_H #include "Edge.h" -#include +#include #include "Wrd.h" class FullHist; Index: parseIt/utils.h =================================================================== --- parseIt/utils.h (revision 28) +++ parseIt/utils.h (working copy) @@ -25,8 +25,8 @@ #define UTILS_H #include -#include -#include +#include +#include #include "ECString.h" void error(const char *s); Index: parseIt/FeatureTree.C =================================================================== --- parseIt/FeatureTree.C (revision 28) +++ parseIt/FeatureTree.C (working copy) @@ -1,7 +1,9 @@ #include "FeatureTree.h" #include "ECString.h" -#include +#include +#include + FeatureTree* FeatureTree::roots_[20]; extern int MinCount; Index: parseIt/Term.h =================================================================== --- parseIt/Term.h (revision 28) +++ parseIt/Term.h (working copy) @@ -3,11 +3,11 @@ #define TERM_H #include "ECString.h" -#include -#include +#include +#include #include -#include -#include +#include +#include class Term; Index: parseIt/CntxArray.h =================================================================== --- parseIt/CntxArray.h (revision 28) +++ parseIt/CntxArray.h (working copy) @@ -2,7 +2,7 @@ #ifndef CNTXARRAY_H #define CNTXARRAY_H -#include +#include class CntxArray { @@ -10,7 +10,7 @@ CntxArray(); CntxArray(int* data); friend int operator< (CntxArray a1, CntxArray a2); - friend ostream& operator<< ( ostream& os, const CntxArray& ca ); + friend std::ostream& operator<< ( std::ostream& os, const CntxArray& ca ); int d[7]; static int sz; }; Index: parseIt/ParseStats.h =================================================================== --- parseIt/ParseStats.h (revision 28) +++ parseIt/ParseStats.h (working copy) @@ -2,7 +2,7 @@ #ifndef PARSESTATS_H #define PARSESTATS_H -#include +#include class ParseStats { Index: parseIt/FeatureTree.h =================================================================== --- parseIt/FeatureTree.h (revision 28) +++ parseIt/FeatureTree.h (working copy) @@ -3,8 +3,8 @@ #define FEATURETREE_H #include -#include -#include +#include +#include #include "Feat.h" #include "FBinaryArray.h"