The textbook covers the Porter stemming algorithm in some detail. If you want to study this (and other stemmers) at the source code level, see, e.g., here or here.