#include <boost/config.hpp>
#include <iostream>
#include <boost/tokenizer.hpp>
#include <boost/bimap/bimap.hpp>
using namespace boost::bimaps;
typedef bimap<std::string,std::string> dictionary;
typedef dictionary::value_type translation;
int main()
{
dictionary d;
d.insert( translation("hola" ,"hello" ));
d.insert( translation("adios","goodbye"));
d.insert( translation("rosa" ,"rose" ));
d.insert( translation("mesa" ,"table" ));
std::cout << "enter a word" << std::endl;
std::string word;
std::getline(std::cin,word);
dictionary::left_const_iterator it = d.left.find(word);
if( it != d.left.end() )
{
std::cout << word << " is said "
<< it->second
<< " in English" << std::endl;
}
else
{
dictionary::right_const_iterator it2 = d.right.find(word);
if( it2 != d.right.end() )
{
std::cout << word << " is said "
<< it2->second
<< " in Spanish" << std::endl;
}
else
{
std::cout << "No such word in the dictionary" << std::endl;
}
}
return 0;
}