public Text read() throws Exception{
        readFromFile();
        ArrayList<PartOfText> partsOfText = new ArrayList<PartOfText>();
        if(null != text){
            Pattern p = Pattern.compile("([^.?!]+[.?!])|(\\n.*\\{(\\n.*\\n)*\\}\\n)|(.+)");
            Matcher m = p.matcher(text);
            String str;
            while(m.find()){
                if(null != (str = m.group(1))){
                    partsOfText.add(new Sentence(str));
                }
                if(null != (str = m.group(2))){
                    partsOfText.add(new Code(str));
                }
                if(null != (str = m.group(4))){
                    partsOfText.add(new Unidentified(str));
                }
            } 
        }
        return (partsOfText.isEmpty()) ? null : new Text(partsOfText);
    }