Yes, a custom made database can. All you need is so that when you pass it the unit type, it looks up a table and returns a armor type that you can process.
The disadvantage is all unit types have to be added to it on map initialization manually via trigged.
You could also try armor type detection via seing how differeint damage types behave on it, however this is more complex.
There are no natives which just return the type so a system has to be made.