First make the pastry. Sieve the flour, sugar and salt into a large mixing bowl. Cut the butter into small pieces and add to the flour. Mix the butter and flour mixture with your fingertips until they resemble breadcrumbs. Add the egg and milk and use a fork to mix everything into dough. Then turn out onto a lightly floured surface and knead for 5 minutes. Wrap the pastry in cling-film and cool in fridge for 30 minutes.
For the pears, place the water and caster sugar in a pot and heat, stirring constantly until the sugar dissolves, reduce the heat and add the lemon juice, cinnamon, vanilla and star anise. Meanwhile peel and core the pears and place in the poaching syrup and bring everything back to the boil, then reduce the heat, put a cover on the pot and simmer for 20 minutes until the pears are tender. Then remove from the pot and leave to cool.
Next grease and flour an 6 individual tart tins and roll out the cooled pastry and line the tins with it. Put the tins back in the fridge for at least 30 minutes.
To make the almond filling, whisk the butter, sugar and eggs until thick and smooth. Then add the ground almonds and flour and beat until smooth. Pour the mixture into the pastries. Cut the pears in half lengthways and slice thinly. Place the pears onto the almond mixture and sprinkle with flaked almonds. Bake in the oven for 30-40 minutes until golden on top. Serve warm.