I was think about AIs and how they would work, when I realised that I couldn't think of a way that an AI could be taught language. A child tends to learn language through associations of language and pictures to an object (e.g., people saying the word "dog" while around a dog, and later realising that people say "a dog" and "a car" and learn what "a" means, etc.). However, a text based AI couldn't use this method to learn, as they wouldn't have access to any sort of input device.
The only way I could come up with is programming in every word, and rule, in the English language (or whatever language it is meant to 'speak' in), however that would, potentially, take years to do.
Does anyone have any ideas on how this could be done? Or if it has been done already, if so how?
By the way, in this context, I am using AI to mean an Artificial Intelligence system with near-human intelligence, and no prior knowledge of language.