In the 2 previous lines I take out the "s", which is the most common case for plural forming. Then if it detects that the last 2 characters are "ie" then there's the special treatment.
As for code style, fixed in https://github.com/telefonicaid/fiware-orion/commit/24a65ae343ae069a116dac7b328b1276d4eaf7c9