1 Samuel 2
1 Then Hannah prayed and said:
"My heart rejoices in the LORD ;
in the LORD my horn  is lifted high.
My mouth boasts over my enemies,
for I delight in your deliverance.
2 "There is no one holy  like the LORD ;
there is no one besides you;
there is no Rock like our God.
3 "Do not keep talking so proudly
or let your mouth speak such arrogance,
for the LORD is a God who knows,
and by him deeds are weighed.
4 "The bows of the warriors are broken,
but those who stumbled are armed with strength.
5 Those who were full hire themselves out for food,
but those who were hungry hunger no more.
She who was barren has borne seven children,
but she who has had many sons pines away.
6 "The LORD brings death and makes alive;
he brings down to the grave  and raises up.
7 The LORD sends poverty and wealth;
he humbles and he exalts.
8 He raises the poor from the dust
and lifts the needy from the ash heap;
he seats them with princes
and has them inherit a throne of honor.
"For the foundations of the earth are the LORD's;
upon them he has set the world.
9 He will guard the feet of his saints,
but the wicked will be silenced in darkness.
"It is not by strength that one prevails;
10 those who oppose the LORD will be shattered.
He will thunder against them from heaven;
the LORD will judge the ends of the earth.
"He will give strength to his king
and exalt the horn of his anointed."
11 Then Elkanah went home to Ramah, but the boy ministered before the LORD under Eli the priest.
I recently read Baldwin's commentary on 1 Samuel discussing whether Hannnah composed extemporaneously or merely sang the song she already knew. If she composed it, the question becomes did she write it based on other compositions of the day or was it more original. I believe the dichotomy to be false. Most extemporaneous compositions are based on repeating patterns one has heard before. This is true of most public prayers. People who pray publicly repeat certain types of requests and phrases. Many of the country preachers I listened to growing up often could preach extemporaneously, but they had heard a lot of sermons. A part of how they knew the scripture was listening to a lot of other men preach during revival and camp meetings. Using the phrases she heard others use would have made the song less than it is, the Word of God.