Preheat the oven to 180C/gas 4. Top and tail the onions. Bring a saucepan of water to the boil over a medium heat, add the onions and simmer for about 25 minutes, until tender and easily pierced by the point of a knife.
Drain the onions and allow to cool slightly. Cut them in half and, using a teaspoon, scoop out and reserve the flesh, leaving three layers intact to form your shells.
Carefully slice the reserved onion flesh as finely as possible. Heat 4 tablespoons of the olive oil in a large frying pan, add the sliced onion and fry for 10 minutes, stirring occasionally, until softened. Turn up the heat and cook for another 25 minutes, until the onion is deeply golden and crisp. Transfer to a plate lined with kitchen paper and season well.
Preheat the oven to 180C/gas 4. Wipe the onion pan clean with kitchen towel and add the crushed cumin and coriander seeds. Toast over a medium heat for a couple of minutes, or until fragrant.
Add the remaining olive oil along with the rice, lentils, turmeric, allspice, cinnamon and a pinch each of salt and pepper. Stir to coat the rice with oil, then add the stock, bring up to the boil, cover tightly and simmer over a very low heat for 25–30 minutes, until most of the liquid has evaporated. Remove the lid, cover with a tea towel, pop the lid back on and set aside for 10 minutes.
Stir through the fried onions, toasted almonds and most of the chopped parsley. Season and spoon the mixture into the soft onion shells, filling them generously, then sandwich two sides together and place in an oiled baking dish, spooning any extra filling around the edges.
Sprinkle over the red wine vinegar and sugar, cover the dish tightly with tinfoil and bake in the oven for 25 minutes, removing the foil for the last 5 minutes. Scatter with the remaining flaked almonds. Serve the stuffed onions warm, with a rocket salad on the side.