The grammar cardordirp.grm recognizes phrases describing cardinal quantities (CARD-P) (e.g. "twenty five", "a dozen", "four score"), and ordinal positions and directions (ORDIR-P) in a sequence (e.g. "last but three", "second last", "first","tenth", "hundredth","previous", "very next", "last but two", "next to last", "tenth from last").  It uses phrase types from cardord.grm.