If making the pastry by hand, rub the butter into the flour and icing sugar until the mixture resembles breadcrumbs, then stir in the beaten egg and bring together to form a dough.
Make the filling by creaming the butter and sugar together, then gradually adding the beaten eggs. Scrape down the sides of the bowl and add the ground almonds, flour, and almond extract. Process until well incorporated. Chill this mixture in the fridge.
Roll out the chilled pastry and line a flan tin. Chill if possible.
Spoon the frangipane mixture into the pastry case and top with pear halves, cut side down.
Bake in the oven until set and golden brown. Cool slightly, glaze with apricot jam, and sprinkle with toasted flaked almonds. Serve warm.