fix some bugs in parsing language subtags
semantics.py implements some useful operations on language tags