Apache Tika is used to detect and extract the text from varying file formats. It uses Detector and Parser for the same, as with the name, former is used to detect the content Type of the file and latter is used to parse the text content. Oak uses default Tika config. (XML file defining the Detector and Parser used).
This post illustrates