Examples of YKDocument


Examples of edu.harvard.wcfia.yoshikoder.document.YKDocument

                public void propertyChange(PropertyChangeEvent evt) {
                    System.out.println("caught a " + evt.getPropertyName() //$NON-NLS-1$
                            " event"); //$NON-NLS-1$
                }
            })
            YKDocument d =
                YKDocumentFactory.createYKDocument(new File("~/louise_blurb.txt")); //$NON-NLS-1$
            pr.addDocument(d);
            YKDocument f =
                YKDocumentFactory.createYKDocument(new File("~/prev.txt")); //$NON-NLS-1$
            pr.replaceDocument(d, f);
        } catch (Exception e){
            e.printStackTrace();
        }
View Full Code Here

Examples of edu.harvard.wcfia.yoshikoder.document.YKDocument

    public SingleDocumentWordFrequencyReportAction(Yoshikoder yk) {
        super(yk, SingleDocumentWordFrequencyReportAction.class.getName());
    }
   
    public void actionPerformed(ActionEvent e) {
        final YKDocument doc = yoshikoder.getSelectedDocument();
        if (doc == null) return;
       
        dworker = new DialogWorker(yoshikoder){
            protected void doWork() throws Exception {
                TokenizationCache tcache = yoshikoder.getTokenizationCache();
                TokenList tl = tcache.getTokenList(doc);
                if (tl == null){
                    tl = TokenizationService.getTokenizationService().tokenize(doc);
                    tcache.putTokenList(doc, tl);
                }
               
                WordFrequencyMap map = new WordFrequencyMap(tl);
                DocumentFrequencyReport report =
                    new DocumentFrequencyReport("Word Frequency Report",
                            "Frequencies of each word in " + doc.getTitle(),
                            yoshikoder.getDictionary().getName(),
                            doc, map);
                dia = new YKReportDialog(yoshikoder, report);
            }
            protected void onError() {
View Full Code Here

Examples of edu.harvard.wcfia.yoshikoder.document.YKDocument

            JTable table = new JTable(sorter);
            sorter.setTableHeader(table.getTableHeader());
            table.setFont(yoshikoder.getDisplayFont());
            TableUtil.packColumn(table, 0, 2);
           
            YKDocument doc = (YKDocument)report.getDocuments().get(0);
            JPanel cent = new JPanel(new BorderLayout());
            cent.add( new JScrollPane(table), BorderLayout.CENTER );
            cent.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
            tabs.addTab(doc.getTitle(), cent);
        }
       
        JPanel central = new JPanel(new BorderLayout());
        central.add(tabs, BorderLayout.CENTER);
        central.setBorder(BorderFactory.createEmptyBorder(10,10,10,10));
View Full Code Here

Examples of edu.harvard.wcfia.yoshikoder.document.YKDocument

public class DocumentListModel extends DefaultListModel{
   
    public DocumentListModel(DocumentList dl) {
        super();
        for (Iterator iter = dl.iterator(); iter.hasNext();) {
            YKDocument doc = (YKDocument)iter.next();
            addElement(new DocumentState(doc));
        }       
    }
View Full Code Here

Examples of edu.harvard.wcfia.yoshikoder.document.YKDocument

    //document.setLocale(l);
  }
   
    public static void main(String[] args) {
        JDialog dia = new JDialog((JFrame)null, "Properties");
        YKDocument doc =
            YKDocumentFactory.createYKDocument(new File("/Users/will/bosnia.csv"),
                    "bosnia.csv", "UTF-8", Locale.getDefault());
        DocumentPropertiesPanel panel = new DocumentPropertiesPanel(doc);
        dia.getContentPane().add(panel);
        dia.pack();
View Full Code Here

Examples of edu.harvard.wcfia.yoshikoder.document.YKDocument

        sb.append("<h4>");
        sb.append(Messages.getString("ExportUtil.documentsLabel"));
        sb.append("</h4>");
        sb.append("<ul>\n");
        for (Iterator<YKDocument> iter = proj.getDocumentList().iterator(); iter.hasNext();) {
            YKDocument doc = iter.next();
            sb.append(toHTML(doc));
        }
        sb.append("</ul>\n");
        sb.append(htmlFooter);
       
View Full Code Here

Examples of edu.harvard.wcfia.yoshikoder.document.YKDocument

        recurse((CategoryNode)dict.getRoot(), sb);
        sb.append("</dictionary>\n");
       
        sb.append("<documentlist>\n");
        for (Iterator<YKDocument> iter = proj.getDocumentList().iterator(); iter.hasNext();) {
            YKDocument doc = iter.next();
            sb.append(toXML(doc));
        }
        sb.append("</documentlist>\n");
        sb.append("</ykproject>\n");
       
View Full Code Here

Examples of edu.harvard.wcfia.yoshikoder.document.YKDocument

               
            String charsetName = attributes.getValue("charsetname");
            if (charsetName == null)
              charsetName = FileUtil.systemEncoding;
           
            YKDocument doc = null;
            doc = YKDocumentFactory.createYKDocument(floc, title, charsetName, lloc);
            doc.setLocale(lloc);
           
            String prefFont = attributes.getValue("font");
            if (prefFont != null)
              doc.setPreferedFont(Font.decode(prefFont));
           
            proj.addDocument(doc);
        }
    }
View Full Code Here

Examples of edu.harvard.wcfia.yoshikoder.document.YKDocument

 
  protected Object[][] run(){
    // do the analysis
    DocumentList list = new DocumentListImpl();
    for (int ii=0; ii<files.length; ii++){
      YKDocument doc = YKDocumentFactory.createYKDocument(files[ii]);
      list.add(doc);
    }
        return null;
    }
View Full Code Here

Examples of edu.harvard.wcfia.yoshikoder.document.YKDocument

    public SingleDocumentDictionaryReportAction(Yoshikoder yk) {
        super(yk, SingleDocumentDictionaryReportAction.class.getName());
    }
   
    public void actionPerformed(ActionEvent e) {
        final YKDocument doc = yoshikoder.getSelectedDocument();
        if (doc == null) return;
       
        Node n = yoshikoder.getSelectedNode();
        CategoryNode cnode = null;
        if (n instanceof CategoryNode)
          cnode = (CategoryNode)n;
        else // patternnode
          cnode = (CategoryNode)n.getParent();
        final CategoryNode catnode = cnode;
       
        TaskWorker tworker = new TaskWorker(yoshikoder){
            YKDictionaryReportDialog dia;
          protected void doWork() throws Exception {
                TokenizationCache tcache = yoshikoder.getTokenizationCache();
                TokenList tl = tcache.getTokenList(doc);
                if (tl == null){
                    tl = TokenizationService.getTokenizationService().tokenize(doc);
                    tcache.putTokenList(doc, tl);
                }
               
                EntryFrequencyMap efm = new EntryFrequencyMap(catnode, tl);
               
                DictionaryFrequencyReport catsAndPats =
                    new DictionaryFrequencyReport("Dictionary Entry Frequencies",
                            "Frequencies of each dictionary entry in " + doc.getTitle(),
                            yoshikoder.getDictionary().getName(),
                            doc, efm, true);
                DictionaryFrequencyReport catsOnly =
                    new DictionaryFrequencyReport("Dictionary Entry Frequencies",
                            "Frequencies of each dictionary entry in " + doc.getTitle(),
                            yoshikoder.getDictionary().getName(),
                            doc, efm, false);
               
                dia = new YKDictionaryReportDialog(yoshikoder, catsOnly, catsAndPats, onlyShowCats);
            }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.