Spoilers follow, and this is from the books (not the movies)...

In The Chamber of Secrets:


   Harry retrieves Goderic Gryffindor's sword from the sorting hat during the confrontation with the basilisk. After this Dumbledore keeps hold of the sword in a glass case in his office. 


Then in The Deathly Hallows:


   Harry and Ron do a deal with Griphook to return Gryffindor's sword to the goblins after they have retrieved Hufflepuff's cup, planning to partially double cross him by holding on to it until all the horcruxes have been destroyed. However Griphook double crosses them first, and keeps hold of the sword.


Then, in the battle at the end of the book:


   Voldemort puts the sorting hat on Neville Longbottom's head and sets him on fire. Instead of burning Neville pulls Gryffindor's sword out of the sorting hat and beheads Nagini, destroying Voldemort's last horcrux.


However, if the sword could always be pulled out of the hat by someone sufficiently heroic then why the need to:


   Create a copy of the sword to fool Bellatrix Lestrange into thinking she had the real one in Gringott's vault? Why forge a copy and risk Snape placing it in the lake if it could always have been pulled from the sorting hat, regardless of where it was or how it was protected?


How was Gryffindor's sword pulled from the hat the second time? Surely it was beyond the reach of accio or any other charms once returned to its goblin creators?


Question: What's the deal with alignment languages?
Answer: There are hundreds of languages in daily use throughout the real world, but the syntax, words, and omissions of terms reflect the worldviews of the users. As simple examples, consider the Russian discourtesy toward indefinite articles, use of tonalities in Sinitic tongues, and words denoting relations in various languages (can you say 'brother-in-law' in a single word?).

When certain terms are favored over others, those choices may indicate one's worldview. Similarly certain physical gestures could indicate one's state of mind (orderly, caring, malicious, self-absorbed, etc.). When Gary used the D&amp;D game to introduce alignment concepts of Law/Chaos (and later adding Good/Evil to the mix), Alignment Languages were an early and under-developed side effect. 

A logical argument could be made that one's alignment could be revealed to all by these unconscious word choices and gestures, and the end result of that logic is the "Know Alignment" spell, in which a cleric's perceptions are magically boosted to translate all such clues. (For implementation, however, the spell works without requiring such interaction.)

In actual use in the 1970s and early 1980s, Alignment Communications (whether verbal or otherwise) were incidental tools used to supplement communication already in progress. If you were conversing with a stranger in Common, you could 'slip in' a bit of alignment, to either augment or corroborate the usual discourse. Moral extremists (paladins, assassins, et al.) tended to make such attempts more frequently than others. And in any event, this nonmagical information-gathering was always indicative at most, never reached the level of detail gained by the use of the magical spell.