Ejemplo n.º 1
0
        public void TestGetMapping()
        {
            FullStory fs = FullStoryFactory.GetFullStory(9148746);
            Dictionary <string, HashSet <int> > wordMapping = fs.WordIDMapping;

            Assert.AreEqual(wordMapping.Count > 1, true);
        }
Ejemplo n.º 2
0
        public void TestGetTopSentences()
        {
            FullStory fs = FullStoryFactory.GetFullStory(9231386);
            Dictionary <string, HashSet <int> > wordMapping = fs.WordIDMapping;
            List <SentenceObj> top5Sentences = fs.GetTopSentences(5);

            Assert.AreEqual(top5Sentences.Count > 1, true);
        }
Ejemplo n.º 3
0
 public void TestGetAnchorWords()
 {
     FullStory fs = FullStoryFactory.GetFullStory(9272275);
     //Dictionary<string, HashSet<int>> wordMapping = fs.WordIDMapping;
     //List<string> top5Sentences = fs.GetAnchorWords(10);//fs.GetTopSentences(5);
     //children node = fs.GetNodeById(9271331);
     List <string> topAnchors = fs.GetAnchorWords(10);
     //List<string> topNamedObjects = fs.GetNamedObjects(30);
     //List<string> top5Anchors = fs.GetAnchorWords(node, 5);
     //Assert.AreEqual(topNamedObjects.Count > 1, true);
 }
Ejemplo n.º 4
0
        public HiSumDisplay()
        {
            // sets the client (inner) size of the window for your content
            ClientSize = new Eto.Drawing.Size(600, 400);

            Title = "HiSum";
            TreeGridView view = new TreeGridView()
            {
                Height = 500
            };

            view.Columns.Add(new GridColumn()
            {
                HeaderText = "Summary", DataCell = new TextBoxCell(0), AutoSize = true, Resizable = true, Editable = false
            });
            var textbox = new TextBox()
            {
                Width = 1000
            };
            var button = new Button()
            {
                Text = "Go", Width = 15
            };
            var label = new Label()
            {
                Width = 100
            };
            var tbResult = new TextArea()
            {
                Width = 1000
            };

            button.Click += (sender, e) =>
            {
                Reader           reader      = new Reader();
                List <int>       top100      = reader.GetTop100();
                List <FullStory> fullStories = new List <FullStory>();
                foreach (int storyID in top100.Take(30))
                {
                    FullStory fullStory = reader.GetStoryFull(storyID);
                    fullStories.Add(fullStory);
                }
                TreeGridItemCollection data = GetTree(fullStories);
                view.DataStore = data;
            };
            Content = new TableLayout
            {
                Spacing = new Size(5, 5),              // space between each cell
                Padding = new Padding(10, 10, 10, 10), // space around the table's sides
                Rows    =
                {
                    new TableRow(
                        new Label {
                        Text = "Input URL from Hacker News: ", Width = 200
                    },
                        textbox,
                        button,
                        label
                        ),
                    new TableRow(
                        null,
                        tbResult,
                        null,
                        null
                        ),
                    new TableRow(
                        new Label(),
                        view
                        ),

                    // by default, the last row & column will get scaled. This adds a row at the end to take the extra space of the form.
                    // otherwise, the above row will get scaled and stretch the TextBox/ComboBox/CheckBox to fill the remaining height.
                    new TableRow  {
                        ScaleHeight = true
                    }
                }
            };
        }