Hello there,
I would like to first say that I am by no means what you could even call a moder as I have a million questions my self.
I decided to try and solve this issue, and at my level, I found that it is not quite as easy as what you had shown.
This is the code that would be put in the @Init part of your main class.
GameRegistry.addRecipe(new ItemStack(Item.swordWood, 1),
new Object[]
{
"XYX",
'X', Block.planks, 'Y', new Item.swordWood
});
However, the problem with this is that it does not accept a damaged item. While I have some suspicions as to ways you could go about this, I lack the experience with the base classes and forge classes to figure it out yet.
On a positive note, I believe that you can use an Anvil to do the same thing that you are trying to make a recipe for.
With a quick google search: [lmgtfy]minecraft anvil[/lmgtfy], I was able to come up with the following results.
http://www.minecraftwiki.net/wiki/Anvil
http://www.minecraftwiki.net/wiki/Anvil_mechanics
On a final thought, you may be able to make a modified crafting table, with functionality of the anvil.
Good luck to you.