This is a post-peer-review, pre-copyedit version of an article published in Lecture Notes in Computer Science, International Castle Meeting on Coding Theory and Applications ICMCTA 2017: Coding Theory and Applications, 207-216. The final authenticated version is available online at: http://dx.doi.org/10.1007/978-3-319-66278-7_17 .This paper is devoted to giving a generalization from linear
codes to the larger class of almost affine codes of two different results.
One such result is how one can express the relative generalized Hamming
weights of a pair of codes in terms of intersection properties between the
smallest of these codes and subcodes of the largest code. The other result
tells how one can find the extended weight polynomials, expressing the
number of codewords of each possible weight, for each code in an infinite
hierarchy of extensions of a code over a given alphabet. Our tools will
be demi-matroids and matroids