diff --git a/Makefile b/Makefile index a45634c..1cb9799 100644 --- a/Makefile +++ b/Makefile @@ -5,18 +5,20 @@ LFLAGS=-lcurl -lcurlpp -g -Wall INST_FILE=/usr/local/bin/dictcc TARGET=dictcc -dict : deen.o desv.o dict_imp.o dictcc.o make_lib +dict : deen.o desv.o denl.o dict_imp.o dictcc.o all deen.o : $(CC) $(CFLAGS) $(DICT_DIR)/deen.cc desv.o : $(CC) $(CFLAGS) $(DICT_DIR)/desv.cc +denl.o : + $(CC) $(CFLAGS) $(DICT_DIR)/denl.cc dict_imp.o : $(CC) $(CFLAGS) $(DICT_DIR)/dict_imp.cc dictcc.o : $(CC) $(CFLAGS) dictcc.cc -make_lib : - $(CC) dictcc.o deen.o desv.o dict_imp.o -o $(TARGET) $(LFLAGS) +all : + $(CC) dictcc.o deen.o desv.o denl.o dict_imp.o -o $(TARGET) $(LFLAGS) install: sudo ln -s $(PWD)/$(TARGET) $(INST_FILE) clean : - rm *.o rm $(TARGET) + rm *.o && rm $(TARGET) diff --git a/dict/creator.h b/dict/creator.h index 3ac6d7a..c5f6a73 100644 --- a/dict/creator.h +++ b/dict/creator.h @@ -5,6 +5,7 @@ #include "dict_int.h" #include "desv.h" #include "deen.h" +#include "denl.h" #include "types.h" #include "exceptions.h" @@ -26,6 +27,8 @@ namespace dictcc return std::make_shared(); case DEEN: return std::make_shared(); + case DENL: + return std::make_shared(); default: throw(dict_lang_error(__FILE__, __LINE__)); } diff --git a/dict/denl.cc b/dict/denl.cc new file mode 100644 index 0000000..685ab76 --- /dev/null +++ b/dict/denl.cc @@ -0,0 +1,14 @@ +#include "denl.h" + +namespace dictcc +{ + denl::denl() + { + d_suburl = "denl"; + } + + bool denl::noun(const std::ostringstream& req_answer, str_list_t& res) + { + return false; + } +} // namespace dictcc diff --git a/dict/denl.h b/dict/denl.h new file mode 100644 index 0000000..c46b819 --- /dev/null +++ b/dict/denl.h @@ -0,0 +1,24 @@ +#ifndef DICTCC_DENL_INCLUDED +#define DICTCC_DENL_INCLUDED + +// STD +#include +// Boost +// Dictcc API +#include "dict_int.h" + +namespace dictcc +{ + class denl : public dict + { + // TODO: Implement specifics of the language here. + private: + bool noun(const std::ostringstream& req_answer, str_list_t& res); + public: + denl(); + ~denl() + {} + }; +} // namespace dictcc + +#endif // DICTCC_DENL_INCLUDED diff --git a/dict/dict_imp.cc b/dict/dict_imp.cc index bedd4ac..657c712 100644 --- a/dict/dict_imp.cc +++ b/dict/dict_imp.cc @@ -108,7 +108,7 @@ namespace dictcc std::string dict::langs2str(const lang_t& lt) { // TODO: Add new languages here. - std::vector str = {"DESV", "DEEN"}; + std::vector str = {"DESV", "DEEN", "DENL"}; if (lt >= str.size()) { throw(dict_lang_error(__FILE__, __LINE__)); } @@ -121,6 +121,8 @@ namespace dictcc return DESV; } else if ( str == "DEEN") { return DEEN; + } else if ( str == "DENL") { + return DENL; } else { throw(dict_lang_error(__FILE__, __LINE__)); } diff --git a/dict/types.h b/dict/types.h index 58f811a..5342d63 100644 --- a/dict/types.h +++ b/dict/types.h @@ -24,7 +24,8 @@ namespace dictcc typedef enum { DESV, - DEEN + DEEN, + DENL } lang_t; } // namespace dictcc diff --git a/dictcc.cc b/dictcc.cc index ddda1cc..1833f41 100644 --- a/dictcc.cc +++ b/dictcc.cc @@ -11,7 +11,8 @@ int main(int argc, char **argv) // TODO: Add new languages here. std::ostringstream langs; langs << " DESV" << std::endl - << " DEEN" << std::endl; + << " DEEN" << std::endl + << " DENL" << std::endl; // Help stringstream std::ostringstream help; help << "dictcc [OPTION] [ARGUMENT]" << std::endl