You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
880 B
37 lines
880 B
7 years ago
|
Unoffical C++ API for dict.cc
|
||
|
|
||
|
## Prequisites
|
||
|
curl and curlpp have to be installed on the system.
|
||
|
|
||
|
## Installation
|
||
|
|
||
|
So far only a quick and dirty solution is available:
|
||
|
|
||
|
bash compile_and_install_ubuntu.sh
|
||
|
|
||
|
Works definitely under Ubuntu, other OS unsure and untested. CMake file will follow.
|
||
|
|
||
|
## Usage of the CLI
|
||
|
|
||
|
Type
|
||
|
|
||
|
dictcc -h
|
||
|
|
||
|
## Usage of the Library
|
||
|
An example of how the library is supposed to be used is given with the CLI (*dictcc.cc*). The following
|
||
|
code creates a dictionary and performs a search.
|
||
|
|
||
|
```c++
|
||
|
#include "dict.h"
|
||
|
|
||
|
...
|
||
|
|
||
|
dictionary = dictcc::creator::create(lang);
|
||
|
result = dictionary->search(search_chr);
|
||
|
```
|
||
|
|
||
|
`dictcc::creator::create` takes a string e.g. DESV and returns a
|
||
|
`std::smart_ptr` to a dictionary object. The return value of the search
|
||
|
function is a smart pointer to a `std::pair` of two string vectors, each
|
||
|
corresponding to one language.
|