Repository: rasahq/rasa
Issue: Synonyms are ignored

**rasa NLU version:** 0.8.0a11
**Used backend / pipeline:** nlp_spacy, ner_spacy, ner_synonyms
**Operating system**: osx
**Content of configuration file**
```json
{
  "pipeline": ["nlp_spacy","ner_spacy","ner_synonyms"],
  "path" : "./models_0.8",
  "data" : "./training.json"
}
```
**Issue:**
Entity values are not mapped to their synonyms

```python
def train():
    training_obj = {
        "rasa_nlu_data": {
            "common_examples": [
                {
                    "text": "in the center of NYC",
                    "intent": "search",
                    "entities": [
                        {
                            "start": 17,
                            "end": 20,
                            "value": "New York City",
                            "entity": "city"
                        }
                    ]
                },
                {
                    "text": "in the centre of New York City",
                    "intent": "search",
                    "entities": [
                        {
                            "start": 17,
                            "end": 30,
                            "value": "New York City",
                            "entity": "city"
                        }

                    ]
                }
            ]
        }
    }

    with codecs.open('training_0.8/training.json', 'w') as outfile:
        json.dump(training_obj, outfile, indent=4)

    training_data = load_data('training_0.8/training.json')
    trainer = Trainer(RasaNLUConfig("config0.8.json"))
    trainer.train(training_data)
    model_directory = trainer.persist('./models_0.8/')
    return model_directory


def test(model_directory):
    metadata = Metadata.load(model_directory)  # where model_directory points to the folder the model is persisted in
    interpreter = Interpreter.load(metadata, RasaNLUConfig("config0.8.json"))

    result = interpreter.parse(u"in the center of NYC")
    print(result)


dir = train()
test(dir)

# Output:
# {u'entities': [{u'start': 17, u'end': 20, u'value': u'NYC', u'entity': u'city'}], ...
```

**Expected**
 `{u'entities': [{u'start': 17, u'end': 20, u'value': u'**New York City**', u'entity': u'city'}],...`
**Actual**
` {u'entities': [{u'start': 17, u'end': 20, u'value': u'NYC', u'entity': u'city'}],...`



**Additional info**

entity_synonyms.json
```json
{"NYC": "New York City"}
```





Changed files:
rasa_nlu/extractors/entity_synonyms.py

diff --git a/rasa_nlu/extractors/entity_synonyms.py b/rasa_nlu/extractors/entity_synonyms.py
index f147e6edace..558e1821d20 100644
--- a/rasa_nlu/extractors/entity_synonyms.py
+++ b/rasa_nlu/extractors/entity_synonyms.py
@@ -8,6 +8,7 @@ import io
 import json
 import os
 import warnings
+import six
 
 from typing import Any
 from typing import Dict
@@ -86,8 +87,9 @@ class EntitySynonymMapper(Component):
 
     def add_entities_if_synonyms(self, entity_a, entity_b):
         if entity_b is not None:
-            original = entity_a.lower() if type(entity_a) == str else str(entity_a)
-            replacement = entity_b.lower() if type(entity_b) == str else str(entity_b)
+            original = entity_a if isinstance(entity_a, six.text_type) else six.text_type(entity_a)
+            original = original.lower()
+            replacement = entity_b if isinstance(entity_b, six.text_type) else six.text_type(entity_b)
 
             if original != replacement:
                 self.synonyms[original] = replacement