python 3 hashmap solution
\ndef entityParser(self, text: str) -> str:\n\tdic = {\n\t\t"&quot;" : "\\"",\n\t\t"&apos;" : "\\\'",\n\t\t"&amp;" : "&",\n\t\t"&gt;" : ">",\n\t\t"&lt;" : "<",\
```\ndef entityParser(self, text: str) -> str:\n\tdic = {\n\t\t"&quot;" : "\\"",\n\t\t"&apos;" : "\\\'",\n\t\t"&amp;" : "&",\n\t\t"&gt;" : ">",\n\t\t"&lt;" : "<",\n\t\t"&frasl;" : "/",\n\t}\n\tl = len(text)\n\ti = 0\n\tres = []\n\n\twhile i<l:\n\t\tif text[i]=="&":\n\t\t\tj = min(i+7, l)\n\t\t\twhile j>i:\n\t\t\t\tif text[i:j] in dic:\n\t\t\t\t\tres.append(dic[text[i:j]])\n\t\t\t\t\tbreak\n\t\t\t\tj-=1\n\t\t\tif j==i:\n\t\t\t\tres.append(text[i])\n\t\t\t\ti+=1\n\t\t\telse:\n\t\t\t\ti = j\n\t\telse:\n\t\t\tres.append(text[i])\n\t\t\ti+=1\n\treturn "".join(res)\n```
['Python3']