Skip to content

Instantly share code, notes, and snippets.

@brendan-w
Last active March 22, 2016 22:57
Show Gist options
  • Save brendan-w/8e6fea224f3df67beb41 to your computer and use it in GitHub Desktop.
Save brendan-w/8e6fea224f3df67beb41 to your computer and use it in GitHub Desktop.
A patch to get LemmaGen v2.2 C++ to compile on linux
diff -uprN v2.2/lemmagen/project/makefile/Makefile v2.2_fixed/lemmagen/project/makefile/Makefile
--- v2.2/lemmagen/project/makefile/Makefile 2008-04-28 14:34:30.000000000 -0400
+++ v2.2_fixed/lemmagen/project/makefile/Makefile 2016-01-19 18:10:06.206054535 -0500
@@ -27,7 +27,7 @@ OBJINTER=\
$(OBJPATH)/InterLearn.o \
$(OBJPATH)/InterBuild.o \
$(OBJPATH)/InterLemtz.o \
- $(OBJPATH)/InterXval.o \
+ $(OBJPATH)/InterXVal.o \
$(OBJPATH)/InterSplit.o \
$(OBJPATH)/InterTest.o \
$(OBJPATH)/InterStat.o
@@ -207,13 +207,13 @@ $(BINPATH)/lemXval : $(OBJPATH)/lemXval.
$(OBJSCANNER) \
$(OBJPATH)/CmdLineParser.o \
$(OBJPATH)/Xval.o \
- $(OBJPATH)/InterXval.o
+ $(OBJPATH)/InterXVal.o
$(OBJPATH)/lemXval.o : $(MAINPATH)/lemXval.cpp \
- $(OBJPATH)/InterXval.o
+ $(OBJPATH)/InterXVal.o
$(GPP) -c -o $@ $<
-$(OBJPATH)/InterXval.o : $(INTPATH)/InterXval.cpp \
+$(OBJPATH)/InterXVal.o : $(INTPATH)/InterXVal.cpp \
$(INTPATH)/Interface.h \
$(OBJPATH)/Xval.o \
$(OBJPATH)/CmdLineParser.o
diff -uprN v2.2/lemmagen/source/header/MiscLib.h v2.2_fixed/lemmagen/source/header/MiscLib.h
--- v2.2/lemmagen/source/header/MiscLib.h 2008-04-17 01:57:00.000000000 -0400
+++ v2.2_fixed/lemmagen/source/header/MiscLib.h 2016-01-19 18:01:33.158120389 -0500
@@ -23,6 +23,7 @@ Foundation, Inc., 51 Franklin Street, Fi
//#include <crtdbg.h>
#include <cstdlib>
#include <new>
+#include <climits>
#include <utility>
#include <ctime>
@@ -30,6 +31,7 @@ Foundation, Inc., 51 Franklin Street, Fi
#include <float.h>
#include <string>
+#include <cstring>
#include <iostream>
#include <iomanip>
@@ -135,7 +137,7 @@ public:
//container for more acurate random functios
class Rand {
private:
- static const int RAND_MAX_REAL = (RAND_MAX+1);
+ static const int RAND_MAX_REAL = RAND_MAX;
public:
static double nextDouble();
diff -uprN v2.2/lemmagen/source/header/RdrLemmatizer.h v2.2_fixed/lemmagen/source/header/RdrLemmatizer.h
--- v2.2/lemmagen/source/header/RdrLemmatizer.h 2008-03-19 16:20:42.000000000 -0400
+++ v2.2_fixed/lemmagen/source/header/RdrLemmatizer.h 2016-01-19 18:03:39.436739920 -0500
@@ -26,6 +26,7 @@ Foundation, Inc., 51 Franklin Street, Fi
#include <fstream>
#include <iomanip>
#include <sstream>
+#include <cstring>
#ifndef AllInOneFile
#include "RdrLemmData.h"
diff -uprN v2.2/lemmagen/source/header/RdrScanner.h v2.2_fixed/lemmagen/source/header/RdrScanner.h
--- v2.2/lemmagen/source/header/RdrScanner.h 2007-11-30 16:29:58.000000000 -0500
+++ v2.2_fixed/lemmagen/source/header/RdrScanner.h 2016-01-19 18:06:26.719326900 -0500
@@ -18,6 +18,8 @@ Foundation, Inc., 51 Franklin Street, Fi
******************************************************************************/
#pragma once
+#include <typeinfo>
+
#include "RdrLexer.h"
class RdrScanner: private RdrParser, private RdrLexer{
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment