OK so for some insane reason I used "literaturemod" for the modid in the recipe file, when the actual modid is "literature". I must have changed my mind about what to use for the modid at some point, or something like that. Anyways, the recipe actually gets called now, so I could determine that the "empty" slots in the crafting inventory are in fact filled with air, so my matches function was returning false. Now that I've accounted for that, the recipe actually does work the way I intended.