示例#1
0
        public void TestTeaching()
        {
            string userName = "******";

            List <BagOfWords> bags = feedService.GetAllBags();

            UserInterest interest = userService.GetUser(userName);

            if (interest == null)
            {
                interest = userService.AddUser(userName);

                FeedItem document = feedService.GetDocument("tag:blogger.com,1999:blog-19732346.post-6636802898282623833");
                userService.LikeDocument(interest, document);
                document = feedService.GetDocument("tag:blogger.com,1999:blog-19732346.post-1441194024531049182");
                userService.LikeDocument(interest, document);
            }

            BagOfWords userBag = new BagOfWords(interest.Id, interest);

            interest.Ratings = userBag.CalculateRatings(bags).Where(rating => rating.Rating > 0).ToList();
            userService.UpdateUser(interest);

            //userService.RemoveUser(userName);
        }