I want to know how to differentiate them. Usually I put the purple one in library and stone and the white one as the farmer.
There are many types of villagers. Here are some of them:
These villagers wear the usual brown robe and will occasionally farm the crops in the village. They have an inventory and can collect the crops they harvest.
These villagers wear white robes and live in houses will bookshelves and are wiling to trade books.
The Priest villager lives in the tall cobblestone tower, and wears a nice purple robe.
Oh! These are the ones people always hope for! If you see one in a village, there will be a Smithy in the village. There is lava, furnaces and a bonus chest in there that contains nice stuff. He wears a black apron.
Wearing a white apron, these butchers can sell leather at times.
Lastly, there are baby villagers, which can be obtained by breeding villagers, zombie villagers, which can be turned back into a normal villager. When a villager is struck by lightning, it becomes a Witch, similar to the Charged Creeper.
Well I saw there were more villagers than posted here but I went to install an add on for my minecraft and found out that there are 12 different types of villagers and I'll say them in the order that I found them in 1. Armorer 2. Butcher 3. Cleric 4. Farmer 5. Fisherman 6. Fletcher 7. Letherworker 8. Librarian 9. Shepherd 10. Tools smith 11. Weapon smith 12. Zombie villager