This repository has been archived by the owner on Sep 25, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
/
example.html
100 lines (88 loc) · 3.72 KB
/
example.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'>
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link href='https://fonts.googleapis.com/css?family=Architects+Daughter' rel='stylesheet' type='text/css'>
<link rel="stylesheet" type="text/css" href="stylesheets/stylesheet.css" media="screen" />
<link rel="stylesheet" type="text/css" href="stylesheets/pygment_trac.css" media="screen" />
<link rel="stylesheet" type="text/css" href="stylesheets/print.css" media="print" />
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<title>JS Summarize by wkallhof</title>
</head>
<body>
<header>
<div class="inner">
<h1>JS Summarize</h1>
<h2>An NLP Summarizer built with Javascript..</h2>
<a href="https://github.com/wkallhof/js-summarize" class="button"><small>View project on</small>GitHub</a>
</div>
</header>
<div id="content-wrapper">
<div class="inner clearfix">
<section id="main-content">
<h3>
<a name="demo" class="anchor" href="#demo">
<span class="octicon octicon-link"></span>
</a>Demo
</h3>
<label for="title">Title:</label><br>
<input type="text" id="title" placeholder="Paste title here" />
<br>
<label for="input">Full Text:</label><br>
<textarea id="input" name="input" cols="40" rows="5" placeholder="Paste full text here"></textarea>
<input type="button" id="split" value="Summarize" />
<h2 class="title"></h2>
<ul class="teasers"></ul>
</section>
<aside id="sidebar">
<a href="https://github.com/wkallhof/js-summarize/zipball/master" class="button">
<small>Download</small>
.zip file
</a>
<a href="https://github.com/wkallhof/js-summarize/tarball/master" class="button">
<small>Download</small>
.tar.gz file
</a>
<p class="repo-owner"><a href="https://github.com/wkallhof/js-summarize"></a> is maintained by <a href="https://github.com/wkallhof">wkallhof</a>.</p>
<p>This page was generated by <a href="pages.github.com">GitHub Pages</a> using the Architect theme by <a href="https://twitter.com/jasonlong">Jason Long</a>.</p>
</aside>
</div>
</div>
<script src="lib/lodash/lodash.js" type="text/javascript"></script>
<script src="lib/jquery/jquery.js" type="text/javascript"></script>
<script src="lib/tokenizer/tokenizer.js" type="text/javascript"></script>
<script src="js-summarize.js" type="text/javascript"></script>
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-45992591-1");
pageTracker._trackPageview();
} catch(err) {}
</script>
<script type="text/javascript">
$(window).ready(
function () {
$('#split').on('click', function () {
$(".teasers").html("");
var summarizer = new JsSummarize(
{
returnCount: 3
});
var summary = summarizer.summarize($('#title').val(),$('#input').val());
summary.forEach(function(sentence)
{
$(".teasers").append("<li>"+sentence+"</li>");
});
$(".title").text($("#title").val());
});
});
</script>
</body>
</html>