├── __init__.py ├── mm ├── __init__.py ├── lib │ ├── __init__.py │ ├── _snap.so │ └── cpm_communities.py ├── viz │ ├── factory.py │ ├── Metromaps_Website_files │ │ ├── .DS_Store │ │ ├── css │ │ ├── tile-lightbox.js │ │ ├── navigation-bar.css │ │ ├── init_helper.js │ │ ├── drawMap.js │ │ ├── init.js │ │ ├── util.js │ │ ├── helpers.js │ │ ├── layout.js │ │ ├── tile.css │ │ ├── eventhandlers.js │ │ └── drawLines.js │ ├── viz_generator.py │ ├── __init__.py │ ├── web_generator.py │ └── clusterdescription.py ├── entities │ ├── __init__.py │ ├── document.py │ └── InputDocumentSet.py ├── input │ ├── legacy │ │ ├── __init__.py │ │ ├── clustering_files.zip │ │ ├── CreateCooccurrenceGraph │ │ ├── runcliques.py │ │ └── merge.py │ ├── DataHandler.py │ └── __init__.py ├── mapgen │ ├── line_generator.py │ ├── map_generator.py │ ├── __init__.py │ ├── legacy_generator.py │ ├── TranslateMap.py │ ├── inputfeatures.py │ ├── get_words_of_line.py │ └── timeslice.py ├── inputhelpers │ ├── tokencounter.py │ ├── counter.py │ ├── __init__.py │ ├── newshelper.py │ ├── inputhelper.py │ ├── factory.py │ └── stringprocessor.py └── default.yaml ├── tests ├── __init__.py ├── test_build.py └── test_build.yaml ├── domains ├── test │ ├── data │ │ └── 1.txt │ ├── whitelist.txt │ ├── doc_metadata.json │ ├── timeslice_coocurence_graph.pdf │ └── test_data_clustering.json ├── lotr │ └── data │ │ ├── sample_blacklist.txt │ │ ├── Lotr.txt │ │ ├── lotr.zip │ │ ├── whitelist.txt │ │ ├── output │ │ ├── tokentypes.txt │ │ ├── wordbase.txt │ │ └── tokens.txt │ │ ├── wordbase.txt │ │ ├── generate_doc_metadata.py │ │ └── rawtext │ │ ├── 388.txt │ │ ├── 210.txt │ │ ├── 115.txt │ │ ├── 209.txt │ │ ├── 389.txt │ │ ├── 434.txt │ │ ├── 76.txt │ │ ├── 136.txt │ │ ├── 36.txt │ │ ├── 312.txt │ │ ├── 469.txt │ │ ├── 450.txt │ │ ├── 116.txt │ │ ├── 117.txt │ │ ├── 187.txt │ │ ├── 420.txt │ │ ├── 172.txt │ │ ├── 43.txt │ │ ├── 380.txt │ │ ├── 271.txt │ │ ├── 311.txt │ │ ├── 85.txt │ │ ├── 280.txt │ │ ├── 42.txt │ │ ├── 84.txt │ │ ├── 168.txt │ │ ├── 94.txt │ │ ├── 35.txt │ │ └── 520.txt └── visualizations │ ├── .DS_Store │ └── ClusterVisualizationLOTR.zip ├── .gitignore ├── notes ├── 14.04.2014.txt ├── 27.01.2014.txt └── legacy_format.txt ├── requirements.txt ├── sample.yaml ├── docs ├── tutorial.md └── formats │ ├── mm_standard_input.md │ └── visualization_json_fmt.txt ├── lotr.yaml ├── lotr_blacklist.yaml └── mmrun.py /__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /mm/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /mm/lib/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /mm/viz/factory.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /mm/entities/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /mm/input/legacy/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /mm/mapgen/line_generator.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /mm/mapgen/map_generator.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /domains/test/data/1.txt: -------------------------------------------------------------------------------- 1 | I like pizza. -------------------------------------------------------------------------------- /domains/test/whitelist.txt: -------------------------------------------------------------------------------- 1 | I 2 | like 3 | pizza -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.pyc 2 | *.swp 3 | domains/lotr/out 4 | -------------------------------------------------------------------------------- /mm/inputhelpers/tokencounter.py: -------------------------------------------------------------------------------- 1 | import Stemmer 2 | 3 | -------------------------------------------------------------------------------- /domains/lotr/data/sample_blacklist.txt: -------------------------------------------------------------------------------- 1 | More 2 | If 3 | Is 4 | Go -------------------------------------------------------------------------------- /domains/test/doc_metadata.json: -------------------------------------------------------------------------------- 1 | [{"timestamp": "1", "id": "1", "name": "1.txt"}] -------------------------------------------------------------------------------- /mm/lib/_snap.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/snap-stanford/MetroMaps/HEAD/mm/lib/_snap.so -------------------------------------------------------------------------------- /domains/lotr/data/Lotr.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/snap-stanford/MetroMaps/HEAD/domains/lotr/data/Lotr.txt -------------------------------------------------------------------------------- /domains/lotr/data/lotr.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/snap-stanford/MetroMaps/HEAD/domains/lotr/data/lotr.zip -------------------------------------------------------------------------------- /mm/mapgen/__init__.py: -------------------------------------------------------------------------------- 1 | from .cluster_generator import ClusterGenerator 2 | from .legacy_generator import LegacyGenerator -------------------------------------------------------------------------------- /domains/lotr/data/whitelist.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/snap-stanford/MetroMaps/HEAD/domains/lotr/data/whitelist.txt -------------------------------------------------------------------------------- /domains/visualizations/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/snap-stanford/MetroMaps/HEAD/domains/visualizations/.DS_Store -------------------------------------------------------------------------------- /mm/input/legacy/clustering_files.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/snap-stanford/MetroMaps/HEAD/mm/input/legacy/clustering_files.zip -------------------------------------------------------------------------------- /mm/input/legacy/CreateCooccurrenceGraph: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/snap-stanford/MetroMaps/HEAD/mm/input/legacy/CreateCooccurrenceGraph -------------------------------------------------------------------------------- /mm/viz/Metromaps_Website_files/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/snap-stanford/MetroMaps/HEAD/mm/viz/Metromaps_Website_files/.DS_Store -------------------------------------------------------------------------------- /domains/test/timeslice_coocurence_graph.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/snap-stanford/MetroMaps/HEAD/domains/test/timeslice_coocurence_graph.pdf -------------------------------------------------------------------------------- /domains/visualizations/ClusterVisualizationLOTR.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/snap-stanford/MetroMaps/HEAD/domains/visualizations/ClusterVisualizationLOTR.zip -------------------------------------------------------------------------------- /mm/viz/viz_generator.py: -------------------------------------------------------------------------------- 1 | import logging 2 | 3 | 4 | class VizGenerator(object): 5 | def __init__(self, configs): 6 | self.input_map = configs.input_map 7 | self.translator = -------------------------------------------------------------------------------- /domains/lotr/data/output/tokentypes.txt: -------------------------------------------------------------------------------- 1 | // ttypeID type 2 | 10 IN 3 | 3 JJ 4 | 12 RB 5 | 9 VBG 6 | 8 VBD 7 | 0 FW 8 | 5 JJR 9 | 2 NN 10 | 6 VB 11 | 11 VBN 12 | 1 NNS 13 | 7 VBP 14 | 4 VBZ 15 | -------------------------------------------------------------------------------- /mm/input/DataHandler.py: -------------------------------------------------------------------------------- 1 | import sys 2 | import os 3 | import os.path 4 | 5 | class DataHandler(): 6 | def __init__(): 7 | pass 8 | 9 | def to_JSON(): 10 | pass 11 | 12 | 13 | -------------------------------------------------------------------------------- /notes/14.04.2014.txt: -------------------------------------------------------------------------------- 1 | Trying to fix the visualization stuff today. 2 | 3 | With the loss of my old laptop, it seems like a whole bunch of old data went missing. That's ok -- we've got the old json files in the 4 | -------------------------------------------------------------------------------- /mm/inputhelpers/counter.py: -------------------------------------------------------------------------------- 1 | class Counter(): 2 | encoding="UTF-8" 3 | 4 | @staticmethod 5 | def CleanString(arg): 6 | 7 | @staticmethod 8 | def Decode(arg): 9 | unicode(arg, encoding) 10 | 11 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | Jinja2==2.7.2 2 | MarkupSafe==0.21 3 | PyYAML==3.10 4 | matplotlib==1.3.1 5 | networkx==1.8.1 6 | nose==1.3.0 7 | numpy==1.8.0 8 | pyparsing==2.0.1 9 | python-dateutil==2.2 10 | six==1.5.2 11 | virtualenv==1.11.4 12 | -------------------------------------------------------------------------------- /sample.yaml: -------------------------------------------------------------------------------- 1 | # tree format 2 | treeroot: 3 | branch1: 4 | name: hi 5 | branch1-1: 6 | name: Node 1-1 7 | branch2: 8 | name: Node 2 9 | branch2-1: 10 | name: Node 2-1 11 | -------------------------------------------------------------------------------- /notes/27.01.2014.txt: -------------------------------------------------------------------------------- 1 | Currently working on input handler for LOTR which is helping me to understand the different engineering aspects of the project 2 | 3 | I should separate the layer of configuration from the actual use instead of trying to mix the different layers! 4 | 5 | -------------------------------------------------------------------------------- /mm/viz/__init__.py: -------------------------------------------------------------------------------- 1 | def ReadConfig(configs): 2 | ''' Specify a dictionary with configurations ''' 3 | input_helper_name = configs['name'] 4 | helper_module = __import__(input_helper_name, globals=globals()) 5 | helper = helper_module.construct(configs) 6 | return helper -------------------------------------------------------------------------------- /mm/viz/Metromaps_Website_files/css: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: 'Lato'; 3 | font-style: normal; 4 | font-weight: 400; 5 | src: local('Lato Regular'), local('Lato-Regular'), url(http://themes.googleusercontent.com/static/fonts/lato/v7/qIIYRU-oROkIk8vfvxw6QvesZW2xOQ-xsNqO47m55DA.woff) format('woff'); 6 | } 7 | -------------------------------------------------------------------------------- /mm/input/legacy/runcliques.py: -------------------------------------------------------------------------------- 1 | import os 2 | import sys 3 | 4 | 5 | infile = sys.argv[1] 6 | outfile = sys.argv[2] 7 | tempfile = sys.argv[3] 8 | 9 | os.system("./cliquesmain -i:"+infile+" -o:"+tempfile+" > /dev/null") 10 | 11 | os.system("python getchunks.py "+tempfile+" "+outfile) 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /tests/test_build.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python2.7 2 | 3 | import unittest 4 | import os 5 | from mmrun import main 6 | 7 | 8 | class EndToEndTests(unittest.TestCase): 9 | def test_end_to_end_simple(self): 10 | main(os.path.join(os.getcwd(),'tests/test_build.yaml')) 11 | 12 | if __name__=="__main__": 13 | unittest.main() 14 | 15 | -------------------------------------------------------------------------------- /mm/inputhelpers/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | def ReadConfig(configs): 3 | ''' Specify a dictionary with configurations ''' 4 | input_helper_configs = configs['input_helper'] 5 | input_helper_name = input_helper_configs['name'] 6 | helper_module = __import__(input_helper_name, globals=globals()) 7 | helper = helper_module.construct(input_helper_configs) 8 | return helper 9 | -------------------------------------------------------------------------------- /mm/entities/document.py: -------------------------------------------------------------------------------- 1 | class Document: 2 | def __init__(self): 3 | self.name = 'untitled' 4 | self.link = '#' 5 | self.id = 0 6 | self.timestamp = 0 7 | 8 | @property 9 | def tfidf(self): 10 | pass 11 | 12 | def toJSON(self): 13 | raise NotImplemented 14 | 15 | def fromJSON(self): 16 | raise NotImplemented -------------------------------------------------------------------------------- /mm/inputhelpers/newshelper.py: -------------------------------------------------------------------------------- 1 | class NewsHelper(): 2 | 3 | def __init__(self, whitelist, name='new_helper'): 4 | pass 5 | 6 | def run(self): 7 | print 'running' 8 | 9 | def save(self): 10 | print 'saving' 11 | 12 | def __str__(self): 13 | return 'this is a newshelper' 14 | 15 | def construct(configs): 16 | return NewsHelper(**configs) -------------------------------------------------------------------------------- /mm/inputhelpers/inputhelper.py: -------------------------------------------------------------------------------- 1 | import whitelistcounter 2 | import newshelper 3 | 4 | 5 | 6 | def ReadConfig(input_helper_config): 7 | sih = section_input_helper 8 | helper = sih.get('helper') 9 | h = helper.lower() 10 | return { 11 | 'whitelistcounter' : whitelistcounter.FactoryFromConfig(input_helper_config), 12 | 'newshelper': newshelper.FactoryFromConfig(), 13 | }[h] -------------------------------------------------------------------------------- /mm/entities/InputDocumentSet.py: -------------------------------------------------------------------------------- 1 | class InputDocumentSet(): 2 | 3 | 4 | def __init__(self, dirname, doc_metadata, input_helper_class, doc_class): 5 | self.dirname = dirname 6 | self.input_helper_class = input_helper_class 7 | self.doc_class = doc_class 8 | self.doc_list = os.listdir(dirname) 9 | 10 | 11 | @property 12 | def size(self): 13 | return len(doc_list) 14 | -------------------------------------------------------------------------------- /mm/input/__init__.py: -------------------------------------------------------------------------------- 1 | from .slicing import SlicingHandler 2 | 3 | 4 | def ReadConfig(configs): 5 | ''' Specify a dictionary with configurations ''' 6 | input_helper_configs = configs['scoring_helper'] 7 | input_helper_name = input_helper_configs['name'] 8 | helper_module = __import__(input_helper_name, globals=globals()) 9 | helper = helper_module.construct(input_helper_configs) 10 | return helper -------------------------------------------------------------------------------- /mm/viz/Metromaps_Website_files/tile-lightbox.js: -------------------------------------------------------------------------------- 1 | (function(window, document, undefined) { 2 | var TileLightbox = {}; 3 | 4 | // wrap a around divElement 5 | TileLightbox.createLightbox = function(articleObj, divElement){ 6 | $('.fancybox').fancybox(); 7 | 8 | $(".fancybox").fancybox({ 9 | 'width' : '70%' 10 | 11 | }); 12 | 13 | var a = ''; 14 | $divElement = $(divElement); 15 | $divElement.wrap(a); 16 | }; 17 | 18 | window.TileLightbox = TileLightbox; 19 | })(this, this.document); -------------------------------------------------------------------------------- /mm/inputhelpers/factory.py: -------------------------------------------------------------------------------- 1 | 2 | # def __get_assert_value(configs, value): 3 | # if value not in configs: 4 | # print 'Field %s not in configs' % value 5 | # raise ValueError 6 | # return configs.get(value) 7 | 8 | 9 | def ReadConfig(configs): 10 | ''' Specify a dictionary with configurations ''' 11 | input_helper_configs = configs 12 | input_helper_name = input_helper_configs['name'] 13 | helper_module = __import__(input_helper_name, globals=globals()) 14 | helper = helper_module.construct(input_helper_configs) 15 | return helper 16 | -------------------------------------------------------------------------------- /mm/viz/Metromaps_Website_files/navigation-bar.css: -------------------------------------------------------------------------------- 1 | .main-menu { 2 | padding-bottom: 15px; 3 | width:100%; 4 | background: rgb(255,255,255); 5 | } 6 | 7 | /*The Top Logo Part*/ 8 | .brand { 9 | width:100%; 10 | 11 | border-bottom: 5px solid rgb(0,0,0); 12 | position:relative; 13 | } 14 | 15 | /*The Logo*/ 16 | .brand .logo { 17 | text-align:left; 18 | color: #000000; 19 | font-size: 2em; 20 | font-weight:bolder; 21 | } 22 | 23 | .main-menu .brand .info-link { 24 | margin-left: 15px; 25 | text-indent:50px; 26 | color: #000000; 27 | } 28 | 29 | -------------------------------------------------------------------------------- /domains/lotr/data/wordbase.txt: -------------------------------------------------------------------------------- 1 | // stemID stemmed 2 | 14 aragorn 3 | 0 bilbo 4 | 3 frodo 5 | 4 sam 6 | 5 merry 7 | 8 pippin 8 | 21 peregrin 9 | 9 gandalf 10 | 10 tom 11 | 26 radagast 12 | 16 orcs 13 | 19 legolas 14 | 32 treebeard 15 | 29 thjoden 16 | 28 jomer 17 | 2 bagginses 18 | 30 ents 19 | 1 baggins 20 | 7 troll 21 | 18 gimli 22 | 24 gollum 23 | 33 wormtongue 24 | 11 glorfindel 25 | 12 elrond 26 | 13 sauron 27 | 35 orcses 28 | 6 strider 29 | 17 arwen 30 | 20 boromir 31 | 27 fangorn 32 | 15 bombadil 33 | 23 denethor 34 | 22 meriadoc 35 | 25 saruman 36 | 34 jowyn 37 | 37 angmar 38 | 36 faramir 39 | 31 uruk-hai 40 | 38 goldberry 41 | -------------------------------------------------------------------------------- /domains/lotr/data/output/wordbase.txt: -------------------------------------------------------------------------------- 1 | // stemID stemmed 2 | 14 aragorn 3 | 0 bilbo 4 | 3 frodo 5 | 4 sam 6 | 5 merry 7 | 8 pippin 8 | 21 peregrin 9 | 9 gandalf 10 | 10 tom 11 | 26 radagast 12 | 16 orcs 13 | 19 legolas 14 | 32 treebeard 15 | 29 thjoden 16 | 28 jomer 17 | 2 bagginses 18 | 30 ents 19 | 1 baggins 20 | 7 troll 21 | 18 gimli 22 | 24 gollum 23 | 33 wormtongue 24 | 11 glorfindel 25 | 12 elrond 26 | 13 sauron 27 | 35 orcses 28 | 6 strider 29 | 17 arwen 30 | 20 boromir 31 | 27 fangorn 32 | 15 bombadil 33 | 23 denethor 34 | 22 meriadoc 35 | 25 saruman 36 | 34 jowyn 37 | 37 angmar 38 | 36 faramir 39 | 31 uruk-hai 40 | 38 goldberry 41 | -------------------------------------------------------------------------------- /domains/lotr/data/generate_doc_metadata.py: -------------------------------------------------------------------------------- 1 | #!/usr/local/bin/python2.7 2 | 3 | 4 | import os 5 | import os.path 6 | import sys 7 | import json 8 | 9 | if (len(sys.argv) != 2): 10 | print "Please enter output json file as second parameter" 11 | print "./generate_doc_metadata.py doc_meta.json" 12 | 13 | 14 | BASE_DIR = "rawtext" 15 | all_files = os.listdir(BASE_DIR) 16 | doc_list = [] 17 | all_files.sort(key=lambda x: int(x.split('.')[0])) 18 | for i,f in enumerate(all_files): 19 | f = {'id': str(i+1), 'name': f, 'timestamp': f.split('.')[0]} 20 | doc_list.append(f) 21 | 22 | json.dump(doc_list, open(sys.argv[1],'w')) 23 | 24 | -------------------------------------------------------------------------------- /mm/viz/Metromaps_Website_files/init_helper.js: -------------------------------------------------------------------------------- 1 | function updateJSON(newData) { 2 | 3 | currentData = newData; 4 | nodes = []; 5 | lines = []; 6 | currentSelectedNode = null; 7 | 8 | var nodeObjs = newData.nodes; 9 | var lineObjs = newData.lines; 10 | 11 | for (var n in nodeObjs) { 12 | var node = nodeObjs[n]; 13 | nodes.push(node); 14 | } 15 | 16 | for (var l in lineObjs) { 17 | var line = lineObjs[l]; 18 | lines.push(line); 19 | } 20 | 21 | // for now, set selected node to be first node 22 | for (var k in nodeObjs) { 23 | break; 24 | } 25 | currentSelectedNode = k; 26 | 27 | initialize(); 28 | drawMap(); 29 | } -------------------------------------------------------------------------------- /mm/lib/cpm_communities.py: -------------------------------------------------------------------------------- 1 | # 2 | # clique percolation method for community detection 3 | # 4 | 5 | import sys 6 | 7 | import snap 8 | 9 | def cmp(gname, size): 10 | G = snap.LoadEdgeList(snap.PUNGraph, gname, 0, 1) 11 | print "G: Nodes %d, Edges %d" % (G.GetNodes(), G.GetEdges()) 12 | 13 | Communities = snap.TIntIntVV() 14 | snap.TCliqueOverlap_GetCPMCommunities(G, size, Communities) 15 | 16 | print "---------------" 17 | for C in Communities: 18 | for I in C: 19 | print I 20 | print "---------------" 21 | 22 | if __name__ == '__main__': 23 | 24 | if len(sys.argv) < 3: 25 | print "Usage: " + sys.argv[0] + " " 26 | sys.exit(1) 27 | 28 | gname = sys.argv[1] 29 | size = int(sys.argv[2]) 30 | 31 | cmp(gname, size) 32 | 33 | -------------------------------------------------------------------------------- /mm/inputhelpers/stringprocessor.py: -------------------------------------------------------------------------------- 1 | import string 2 | 3 | class StringProcessor(): 4 | 5 | def __init__(self, in_encoding='UTF-8', encoding='UTF-8'): 6 | self.encoding = encoding 7 | self.in_encoding = in_encoding 8 | 9 | 10 | def encode(self, raw_string): 11 | if isinstance(raw_string, str): 12 | return unicode(raw_string.decode(self.in_encoding).encode(self.encoding),self.encoding) 13 | if isinstance(raw_string, unicode): 14 | return raw_string 15 | 16 | 17 | def clean(self, raw_string): 18 | encoded_string = self.encode(raw_string) 19 | encoded_string = encoded_string.lower() 20 | encoded_string = encoded_string.replace("'s", '') 21 | translate_table = {ord(char): None for char in string.punctuation + string.digits + string.whitespace} 22 | #import pdb; pdb.set_trace() 23 | encoded_string = encoded_string.translate(translate_table) 24 | return encoded_string 25 | -------------------------------------------------------------------------------- /docs/tutorial.md: -------------------------------------------------------------------------------- 1 | # Pipeline 2 | 3 | 4 | 5 | 6 | #Handling Input 7 | 8 | MM is customized by specifying a configuration file at input. The fields that can be edited are in `mm/default.yaml`. 9 | 10 | #Writing your own `input_handler:` 11 | Make sure that your input handler returns the following fields: 12 | 13 | * 'doc_counts' (docid -> [(token_id -> count), (token_id -> count)) 14 | * 'global_counts' (token_id -> global_count) 15 | * 'global_tokens' (word -> token_id) # good idea to use the same id for words with the same stem 16 | * 'representative_tokens' (token_id -> {'plaintext': count}) # the dictionary may contain several plainwords with respective counts. 17 | 18 | Additionally you must create a `doc_metadata.json` file that is a list of dictionaries with the following fields: 19 | [{ 20 | "id": "1", 21 | "name": "1.txt", 22 | "timestamp": "1" 23 | },...] 24 | Specify this file in `legacy helper:` under the key `doc_metadata` (see default.yaml for an example) 25 | 26 | -------------------------------------------------------------------------------- /lotr.yaml: -------------------------------------------------------------------------------- 1 | global: &GLOBALS 2 | doc_metadata: domains/lotr/data/doc_meta.json 3 | 4 | 5 | input_helper: 6 | <<: *GLOBALS 7 | mode: on 8 | name: whitelistcounter 9 | whitelist: domains/lotr/data/whitelist.txt 10 | input_directory: domains/lotr/data/rawtext 11 | 12 | slicing: 13 | <<: *GLOBALS 14 | mode: on 15 | num_timeslices: 20 16 | 17 | 18 | clustering: 19 | <<: *GLOBALS 20 | mode: on 21 | similarity_merge: .95 # / above this limit merges 22 | dilution_merge: .1 23 | 24 | 25 | mapgen: 26 | <<: *GLOBALS 27 | mode: on 28 | chosen_lines: domains/lotr/out/final/lotr.mm 29 | chosen_lines_json: domains/lotr/out/final/lotr.json 30 | 31 | vizbuilder: 32 | <<: *GLOBALS 33 | mode: on 34 | name: clusterdescription 35 | input_lines_json: domains/lotr/out/final/lotr.json 36 | final_map_viz_json: domains/lotr/out/final/lotr_viz.json 37 | producehtml: on 38 | website_output_dir: domains/lotr/out 39 | webpage_name: LOTR.html 40 | -------------------------------------------------------------------------------- /docs/formats/mm_standard_input.md: -------------------------------------------------------------------------------- 1 | #### Format of global.mm_standard_input 2 | 3 | This JSON file that is considered standard input to metromaps (along with `doc_metadata`) contains four fields: global_counts maps stem-id to count; doc_counts maps doc-id to a dictionary containing how many times each stem-id appears there; global_tokens maps each stem to its stem-id; and representative-token gives each stem-id to all possible words it appears in and individual counts. 4 | 5 | {"global_counts": {"1": 494, "2": 111, ...}, 6 | 7 | "doc_counts": {"1": {"1": 14, "2": 9, "3": 12, "4": 2, "5": 1}, "2": {"1": 15, "2": 4, "3": 13, "4": 1, "6": 5}, ...} 8 | 9 | "global_tokens": {"radagast": 29, "sam": 5, "bilbo": 1, "denethor": 26, "arwen": 19, "wormtongue": 35, "treebeard": 33, "gandalf": 11,...} 10 | 11 | "representative_tokens": {"1": {"`Bilbo!'": 2, "'Bilbo": 4, "Bilbo's.": 2, "Bilbo": 254, "Bilbo)": 1, "Bilbo.": 79, "Bilbo,": 63, "Bilbo!'": 2, "Bilbo?'": 1, "'Bilbo!'": 2, "Bilbo,'": 10, "Bilbo;": 4, "Bilbo's": 70}, "2": {"Baggins!'": 1, "'Baggins": 1, "Baggins;": 4, "Baggins.'": 3, "BAGGINS,": 1, "Baggins,'": 4, "BAGGINS": 2, "\"Baggins": 2, "Baggins'": 3, "Baggins?\"": 2, "Baggins": 56, "Baggins?'": 2, "Baggins,": 15, "Baggins.": 15}, ...} 12 | } -------------------------------------------------------------------------------- /lotr_blacklist.yaml: -------------------------------------------------------------------------------- 1 | global: &GLOBALS 2 | doc_metadata: domains/lotr/data/doc_meta.json 3 | 4 | 5 | input_helper: 6 | <<: *GLOBALS 7 | mode: off 8 | name: blacklistcounter 9 | blacklist: domains/lotr/data/sample_blacklist.txt 10 | discard_frequency: 30 11 | whitelist: domains/lotr/data/whitelist.txt 12 | input_directory: domains/lotr/data/rawtext 13 | 14 | slicing: 15 | <<: *GLOBALS 16 | mode: off 17 | num_timeslices: 20 18 | 19 | 20 | clustering: 21 | <<: *GLOBALS 22 | mode: on 23 | min_freq_in_doc: 2 # only accept tokens appearing at least twice per doc 24 | tfidf_accept: 3.5 # accept tfidf above this 25 | max_tokens_per_doc: 30 # if this number is too high, then clique perc will take ages 26 | similarity_merge: .95 # / above this limit merges 27 | dilution_merge: .1 28 | 29 | 30 | mapgen: 31 | <<: *GLOBALS 32 | mode: on 33 | chosen_lines: domains/lotr/out/final/lotr.mm 34 | chosen_lines_json: domains/lotr/out/final/lotr.json 35 | 36 | vizbuilder: 37 | <<: *GLOBALS 38 | mode: on 39 | name: clusterdescription 40 | input_lines_json: domains/lotr/out/final/lotr.json 41 | final_map_viz_json: domains/lotr/out/final/lotr_viz.json 42 | producehtml: on 43 | website_output_dir: domains/lotr/out 44 | webpage_name: LOTR.html 45 | -------------------------------------------------------------------------------- /notes/legacy_format.txt: -------------------------------------------------------------------------------- 1 | 1. Produce (# number of timeslices, defaulted at 10) timeslices 2 | 3 | 20130507 4 | 1950 5 | 20130507 20130509 6 | 7 | 2013050917320000017 0.901063 8 | 2013050917320000017 201305091732 http://news.yahoo.com/texas-jobs-visit-president-obama-gets-own-meme-173211660.html For Texas jobs visit , President Obama gets his own meme - Yahoo ! News 9 | 144751 0.631649 10 | 321424 1.769479 11 | 373759 1.812832 12 | 152146 1.008436 13 | 74120 0.901063 14 | 50437 1.121969 15 | 60625 1.499666 16 | 370378 0.661400 17 | 18 | 2013050906300000004 0.795108 19 | 2013050906300000004 201305090630 http://news.yahoo.com/video/obama-zombie-company-says-just-053000388.html Obama the Zombie ? Company says it 's just a coincidence | Watch the video - Yahoo ! News 20 | 6596 0.404332 21 | 64302 0.579387 22 | 395951 0.617463 23 | 366925 0.403320 24 | 131612 0.209205 25 | 1170 0.847750 26 | 7830 0.518136 27 | 272968 0.506242 28 | 315106 0.847428 29 | 396873 0.681517 30 | 273665 0.737815 31 | 178566 0.875292 32 | 30328 0.444388 33 | 391472 0.643900 34 | 23001 0.245988 35 | 335459 0.403782 36 | 193336 0.369010 37 | 172646 0.539063 38 | 120089 0.755369 39 | 60442 0.251936 40 | 173097 0.421749 41 | 201177 1.044996 42 | 74120 0.795108 43 | 107639 0.267658 44 | 311365 0.789031 45 | 246083 0.401469 46 | 39372 0.454235 47 | 215972 0.295738 48 | 39756 0.594753 49 | 62351 0.615664 50 | -------------------------------------------------------------------------------- /mm/mapgen/legacy_generator.py: -------------------------------------------------------------------------------- 1 | import subprocess 2 | import logging 3 | import generate_all_lines 4 | import get_words_of_line 5 | import candidate_lines_to_map 6 | 7 | class LegacyGenerator(object): 8 | def __init__(self, configs): 9 | # configs has > cluster_dir (storing clusters in plaintext legacy format) and 10 | # > out_dir (directory to which the map will be written) 11 | self.cluster_dir = configs['cluster_dir'] 12 | self.raw_lines = configs['raw_lines'] 13 | self.line_descriptions = configs['line_descriptions'] 14 | self.chosen_lines = configs['chosen_lines'] 15 | self.chosen_lines_json = configs['chosen_lines_json'] 16 | 17 | 18 | def run(self): 19 | # devnull = open('/dev/null', 'w') 20 | # process = subprocess.Popen(['python2.7', 'generate_all_lines.py', self.cluster_dir, self.out_dir, 'blank']) 21 | # retcode = process.wait() 22 | # logging.info('Generate all lines finished: code %s' % str(retcode)) 23 | generate_all_lines.main(self.cluster_dir, self.raw_lines) 24 | logging.info('Line generator done. See %s for output' %self.raw_lines) 25 | get_words_of_line.main(self.raw_lines,self.line_descriptions) 26 | logging.info('Getting description done. See %s for output' %self.line_descriptions) 27 | candidate_lines_to_map.main(self.line_descriptions, self.chosen_lines, self.chosen_lines_json) 28 | logging.info('Getting map done. See %s (and %s) for output' % (self.chosen_lines, self.chosen_lines_json)) 29 | -------------------------------------------------------------------------------- /tests/test_build.yaml: -------------------------------------------------------------------------------- 1 | global: 2 | log_level: 'error' 3 | 4 | input_helper: 5 | mode: on 6 | name: whitelistcounter 7 | encoding: UTF-8 8 | in_encoding: cp1252 9 | whitelist: domains/test/whitelist.txt # FILL OUT example: domains/lotr/data/whitelist.txt (new-line separated) 10 | input_directory: domains/test/data # FILL OUT example: domains/lotr/data/rawtext 11 | outfile: &input_out /tmp/mm_input.json 12 | #docs_metadata: 13 | 14 | legacy_helper: 15 | mode: on 16 | input_json_file: *input_out #your_output_from_above FILL OUT HERE 17 | output_dir: /tmp/query_result 18 | doc_metadata: domains/test/doc_metadata.json ## FILL OUT 19 | num_timeslices: 1 20 | output_json: &score_JSON /tmp/legacy_handler_out.json 21 | choose_representative_token: on 22 | 23 | 24 | clustering: 25 | mode: on 26 | input_json: *score_JSON 27 | similarity_merge: 1 # / above this limit merges 28 | dilution_merge: 0 # only <= below this number is merged. This is percentage of new terms that can be added 29 | output_json: &clusters_JSON /tmp/clusters.json 30 | graphing: off 31 | out_graph_dir: /tmp/timeslice_graphs/ 32 | # Remove the following when cleaning project 33 | out_legacy_dir: /tmp/clusters/clusters 34 | 35 | mapgen: 36 | mode: on 37 | cluster_dir: /tmp/clusters 38 | raw_lines: /tmp/raw_lines 39 | line_descriptions: /tmp/line_descriptions 40 | chosen_lines: /tmp/final_lines.mm 41 | chosen_docs_for_map: final_map.mm 42 | 43 | -------------------------------------------------------------------------------- /mm/viz/Metromaps_Website_files/drawMap.js: -------------------------------------------------------------------------------- 1 | /************************** 2 | Map: Kick off the map 3 | **************************/ 4 | 5 | drawMap(); 6 | 7 | function drawMap() { 8 | drawTime(); 9 | drawLines(); 10 | drawNodes(); 11 | drawLineLabels(); 12 | stage.add(layer); 13 | } 14 | 15 | function drawTime() { 16 | var dateSortedNodes = sortByDate(nodes); 17 | var onethird_index = Math.floor(dateSortedNodes.length / 3); 18 | var twothird_index = Math.floor(dateSortedNodes.length * 2 / 3); 19 | var onethird_date = dateSortedNodes[onethird_index].time; 20 | var twothird_date = dateSortedNodes[twothird_index].time; 21 | var onethird_xpos = dateSortedNodes[onethird_index].x; 22 | var twothird_xpos = dateSortedNodes[twothird_index].x; 23 | 24 | var onethird_line = new Kinetic.Line({ 25 | points: [onethird_xpos, 0, onethird_xpos, 400], 26 | stroke: 'black', 27 | strokeWidth: 1, 28 | }); 29 | var twothird_line = new Kinetic.Line({ 30 | points: [twothird_xpos, 0, twothird_xpos, 400], 31 | stroke: 'black', 32 | strokeWidth: 1, 33 | }); 34 | var onethird_label = new Kinetic.Text({ 35 | x: onethird_xpos+5, 36 | y: 380, 37 | text: onethird_date, 38 | fontSize: 12, 39 | fontFamily: 'Calibri', 40 | fill: 'black' 41 | }); 42 | var twothird_label = new Kinetic.Text({ 43 | x: twothird_xpos+5, 44 | y: 380, 45 | text: twothird_date, 46 | fontSize: 12, 47 | fontFamily: 'Calibri', 48 | fill: 'black' 49 | }); 50 | 51 | layer.add(onethird_line); 52 | layer.add(twothird_line); 53 | layer.add(onethird_label); 54 | layer.add(twothird_label); 55 | } -------------------------------------------------------------------------------- /docs/formats/visualization_json_fmt.txt: -------------------------------------------------------------------------------- 1 | { 2 | "articles": { 3 | "id" : { 4 | "id":same_id_as_key -- string 5 | "image":"/static/img.png 6 | "importance":"1" 7 | "nodeID": 8 | "previewText": "some text that's visible" 9 | "publisher": "string" 10 | "timestamp": "2013-03-02" 11 | "title": "your title for the article" 12 | "url" : "http://" 13 | } 14 | } 15 | "lines": { 16 | "id": 0, (this is an int) 17 | "line_label": "label for the line" 18 | "nodeIDs": [ 19 | "somelongid_1", 20 | "somelongid_1", 21 | ] 22 | }, 23 | "nodes":{ 24 | "nodeid": { 25 | "id": "same as the key -- string" 26 | "articleIDs":[ 27 | list of article ids from above 28 | ], 29 | "cluster_words": "aviv israel tel tel_aviv", 30 | "importance": "1" 31 | "label": "usually name of the article, but can be anything" 32 | "lineIDs": [ 33 | ints (lineIDs) 34 | ] 35 | "time": "2013-05-02" 36 | } 37 | } 38 | 39 | 40 | } 41 | -------------------------------------------------------------------------------- /mm/viz/Metromaps_Website_files/init.js: -------------------------------------------------------------------------------- 1 | /************************** 2 | Map: Initialize variables and stage/canvas 3 | **************************/ 4 | 5 | /*var serverURL = "ilws19.stanford.edu:8089" 6 | var searchQuery = "tennis"; 7 | var dateString = "W06142013"; 8 | var url = serverURL + "/" + searchQuery + "/" + dateString; 9 | 10 | var data; 11 | $.getJSON( url, function( data ) { 12 | console.log(data); 13 | });*/ 14 | 15 | addEventHandlersToButton(); 16 | 17 | 18 | // Global variables 19 | var stage; 20 | var layer; 21 | var colors; 22 | var currentData = finalJson; 23 | 24 | var nodes = []; 25 | var lines = []; 26 | var currentSelectedNode; 27 | 28 | var nodeObjs = finalJson.nodes; 29 | var lineObjs = finalJson.lines; 30 | 31 | for (var n in nodeObjs) { 32 | var node = nodeObjs[n]; 33 | nodes.push(node); 34 | } 35 | 36 | for (var l in lineObjs) { 37 | var line = lineObjs[l]; 38 | lines.push(line); 39 | } 40 | 41 | // for now, set selected node to be first node 42 | for (var k in nodeObjs) { 43 | break; 44 | } 45 | currentSelectedNode = k; 46 | 47 | initialize(); 48 | 49 | function initialize() { 50 | $('#map-container').empty(); 51 | 52 | stage = null; 53 | layer = null; 54 | colors = null; 55 | 56 | stage = new Kinetic.Stage({ 57 | container: 'map-container', 58 | width: getPanelWidth(), 59 | height: getPanelHeight(), 60 | draggable: true 61 | }); 62 | 63 | stagePan(stage); 64 | 65 | layer = new Kinetic.Layer({width: getPanelWidth(), height: getPanelHeight()}); 66 | initializeColors(); 67 | setLineProperties(); 68 | setNodeProperties(); 69 | setLayout(); 70 | populateArticles(getNodeByID(currentSelectedNode)); 71 | } -------------------------------------------------------------------------------- /mm/mapgen/TranslateMap.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python2.7 2 | import sys 3 | import os 4 | import os.path 5 | import json 6 | 7 | def Main(MapFile, ClusterToDocJson, FlatDir, MapOut): 8 | cluster_to_doc_dict = None 9 | with open(ClusterToDocJson) as cl_doc: 10 | cluster_to_doc_dict = json.load(cl_doc) 11 | 12 | with open(MapFile) as map_in: 13 | with open(MapOut,'w') as map_out: 14 | for line in map_in.readlines(): 15 | if 'cluster'==line[:len('cluster')]: 16 | cluster_key = line.split()[0] 17 | doc_fname = cluster_to_doc_dict[cluster_key] 18 | doc_fullfname = os.path.join(FlatDir, doc_fname) 19 | with open(doc_fullfname) as doc_json_file: 20 | doc_json = json.load(doc_json_file) 21 | date = doc_json['date'] 22 | name = doc_json['name'] 23 | name_replace = name.replace(' ', '_') 24 | name_replace = name_replace.upper() 25 | name_replace = name_replace + '_' + date[:4] 26 | map_out.write(name_replace) 27 | map_out.write(line[len(cluster_key):]) 28 | else: 29 | map_out.write(line) 30 | 31 | 32 | 33 | 34 | def usage(fname, args): 35 | return 'python %s %s' %(fname, " ".join(args)) 36 | 37 | if __name__=='__main__': 38 | arg = ['MapFile', 'ClusterToDoc.json', 'FlatDir', 'MapOut'] 39 | if (len(sys.argv) != len(arg)+1): 40 | print usage(sys.argv[0], arg) 41 | sys.exit(2) 42 | 43 | 44 | 45 | Main(*sys.argv[1:]) 46 | -------------------------------------------------------------------------------- /mm/viz/web_generator.py: -------------------------------------------------------------------------------- 1 | from jinja2 import Template 2 | import os 3 | import shutil 4 | import json 5 | import logging 6 | 7 | class WebGeneratorViz(object): 8 | def __init__(self, data, outdir, webhtml="Metromaps.html"): 9 | self.data = data 10 | self.outdir = outdir 11 | self.webhtml = webhtml 12 | self.setupok = True 13 | self.viz_base = 'mm/viz' 14 | self.defaultHTML = 'mm/viz/Metromaps.html' 15 | self.js_dir = 'Metromaps_Website_files' 16 | self.defaultJS_dir = os.path.join(self.viz_base, self.js_dir) 17 | self.defaultJS_datafile = 'final-json.js' 18 | if (not os.path.exists(self.outdir)): 19 | logging.error('Out path does not exist: %s' % self.outdir) 20 | self.setupok = False 21 | 22 | def run(self): 23 | if not self.setupok: 24 | logging.error('Aborting web') 25 | return 26 | 27 | destination_js_dir = os.path.join(self.outdir, self.defaultJS_dir) 28 | if not os.path.exists(destination_js_dir): 29 | try: 30 | shutil.copytree(self.defaultJS_dir, os.path.join(self.outdir,self.js_dir)) 31 | except: 32 | logging.error('skipping js-tree copying') 33 | shutil.copyfile(self.defaultHTML, os.path.join(self.outdir, self.webhtml)) 34 | logging.debug('Copied js and html files into %s' % self.outdir) 35 | else: 36 | logging.warning("%s already exists, so we won't copy the entire js dir" % destination_js_dir) 37 | 38 | with open(self.data) as in_f: 39 | json_str = in_f.read() 40 | outfile = os.path.join(self.outdir, self.defaultJS_datafile) 41 | with open(outfile, 'w') as out_f: 42 | out_f.write('var finalJson = %s;' % json_str) 43 | logging.debug('wrote output data file %s' %outfile) 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /mm/mapgen/inputfeatures.py: -------------------------------------------------------------------------------- 1 | import math 2 | 3 | from timeslice import * 4 | 5 | ## INPUT FEATURES ## 6 | class InputFeature(object): 7 | def __repr__(self): 8 | return 'Input Feature' 9 | 10 | def __init__(self, *args): 11 | pass 12 | 13 | @classmethod 14 | def analyze_input(cls, all_features, timeslices): 15 | for feature in cls.__subclasses__(): 16 | feature.report(timeslices) 17 | 18 | def score(self,s): 19 | return 0 20 | 21 | def report(self, timeslices): 22 | return 'n/a but the score is: %s' % (self.score(timeslices)) 23 | 24 | 25 | class NumberClusters(object): 26 | def __repr__(self): 27 | return self.report() 28 | 29 | def __init__(self, timeslices): 30 | self.timeslices = timeslices 31 | 32 | def score(self): 33 | timeslices = self.timeslices 34 | counts = map(lambda x: len(x.clusters), timeslices) 35 | return sum(counts) 36 | 37 | def report(self): 38 | return "Total number of clusters: %i" % self.score() 39 | 40 | 41 | class NumberUniqueWords(object): 42 | def __repr__(self): 43 | return self.report() 44 | 45 | def __init__(self, timeslices): 46 | self.timeslices = timeslices 47 | 48 | 49 | def score(self): 50 | timeslices = self.timeslices 51 | s = set() 52 | for timeslice in timeslices: 53 | for cluster in timeslice.clusters: 54 | words = cluster.words 55 | s.update(set(words)) 56 | return len(s) 57 | 58 | def report(self): 59 | return "Total unique words: %i" % self.score() 60 | 61 | class NumberArticles(object): 62 | def __repr__(self): 63 | return self.report() 64 | 65 | def __init__(self, num_articles): 66 | self.number = num_articles 67 | 68 | def score(self): 69 | return self.number 70 | 71 | def report(self): 72 | return "Associated articles (num): %i" % self.number 73 | 74 | -------------------------------------------------------------------------------- /mm/input/legacy/merge.py: -------------------------------------------------------------------------------- 1 | import sys 2 | filename = sys.argv[1] 3 | outfile = sys.argv[2] 4 | 5 | '''Read file. 6 | Each line of the file is a cluster looking something like this: 7 | Cluster: 7 boston, bomb, finish_line, finished, marathon, line, boston_marathon, 8 | ''' 9 | f = open(filename) 10 | allclusters = [] 11 | for line in f.readlines(): 12 | cluster = set([]) 13 | for word in line.split()[2:]: #skip "cluster: 7" and just get the words 14 | cluster.add(word) 15 | allclusters.append(cluster) 16 | 17 | # lines = f.readlines() 18 | # allclusters = [0]*len(lines) 19 | # for i in range(len(lines)): 20 | # line = lines[i] 21 | # line = line.split()[2:] 22 | # cluster = set([]) 23 | # for word in line: 24 | # cluster.add(word) 25 | # allclusters[i] = cluster 26 | 27 | 28 | allclusters.sort(key=len) #sort low->high so smallest merged with largest first 29 | 30 | SUBSET_CUTOFF = .7 31 | 32 | 33 | def merge(first,second): 34 | for word in first: 35 | second.add(word) 36 | 37 | #Merge clusters if one is a near-subset of the other, ie 38 | #70% of the words in one cluster are in another cluster 39 | def shouldMerge(first, second): 40 | smaller = min(len(first), len(second)) 41 | intersect = len(first & second) #first&second returns intersection 42 | subset_value = intersect/float(smaller) 43 | if subset_value > SUBSET_CUTOFF: 44 | return True 45 | else: 46 | return False 47 | 48 | for i in range(len(allclusters)): #for each cluster 49 | for j in range(i+1, len(allclusters)): #for every subsequent cluster 50 | if shouldMerge(allclusters[i], allclusters[j]): 51 | merge(allclusters[i], allclusters[j]) #add i words to j 52 | allclusters[i]=set([]) #delete set 53 | break 54 | 55 | #write clusters to file 56 | f = open(outfile, 'w') 57 | for cluster in allclusters: 58 | if len(cluster)==0: #don't write out empty/deleted sets 59 | continue 60 | f.write("Cluster: ") 61 | f.write(str(len(cluster))+" ") 62 | for word in cluster: 63 | f.write(word+" ") 64 | f.write("\n") 65 | f.close() 66 | 67 | 68 | -------------------------------------------------------------------------------- /mm/viz/Metromaps_Website_files/util.js: -------------------------------------------------------------------------------- 1 | (function(window, document, undefined) { 2 | var Util = {}; 3 | 4 | Util.getColorArray = function(nrOfColors) { 5 | var result = new Array(); 6 | var colorArrayOverview = new Array(); 7 | 8 | var colorArray = ["#FF4900", "#FF9200", "#0B61A4", "#00AF64", "#ffde00"]; 9 | colorArrayOverview.push(colorArray); 10 | 11 | var colorArray2 = ["#00efec", "#FF7400", "#009999", "#00CC00", "#3914AF"]; 12 | colorArrayOverview.push(colorArray2); 13 | 14 | // // cyan, green, pink, purple 15 | var colorArray3 = ["#00efec", "#9FEE00", "#CD0074", "#7109AA", "#0A67A3"]; 16 | colorArrayOverview.push(colorArray3); 17 | 18 | var colorArray4 = ["#3fb8e8", "#e86f3f", "#3f63e8", "#e83f63", "#b8e83f"]; 19 | colorArrayOverview.push(colorArray4); 20 | 21 | var colorArray5 = ["#D50096", "#22C3C3", "#48E470", "#9c6eff", "#FF9900"]; 22 | colorArrayOverview.push(colorArray5); 23 | 24 | var colorArrayIndex = Math.floor(Math.random()*colorArrayOverview.length); 25 | for (var i = 0; i < nrOfColors; i++) { 26 | result.push(colorArrayOverview[colorArrayIndex][i]); 27 | } 28 | return result; 29 | 30 | }; 31 | 32 | Util.getHighlightedColor = function(color) { 33 | var reduceRGBby = 20; 34 | var articleColorRGB = hexToRgb(color); 35 | var articleColor = rgbToHex(Math.max(articleColorRGB.r - reduceRGBby,0),Math.max(articleColorRGB.g - reduceRGBby,0) , Math.max(articleColorRGB.b - reduceRGBby,0)); 36 | return articleColor; 37 | }; 38 | 39 | function hexToRgb(hex) { 40 | var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex); 41 | return result ? { 42 | r: parseInt(result[1], 16), 43 | g: parseInt(result[2], 16), 44 | b: parseInt(result[3], 16) 45 | } : null; 46 | } 47 | 48 | function componentToHex(c) { 49 | var hex = c.toString(16); 50 | return hex.length == 1 ? "0" + hex : hex; 51 | } 52 | 53 | function rgbToHex(r, g, b) { 54 | return "#" + componentToHex(r) + componentToHex(g) + componentToHex(b); 55 | } 56 | 57 | 58 | 59 | window.Util = Util; 60 | })(this, this.document); -------------------------------------------------------------------------------- /domains/lotr/data/rawtext/388.txt: -------------------------------------------------------------------------------- 1 | two Orcs up: their voices were growing nearer again. Now they seemed quite 2 | close. 3 | `That's what I'm going to do,' said Shagrat in angry tones. 'Put him 4 | right up in the top chamber.' 5 | `What for? ' growled Gorbag. `Haven't you any lock-ups down below? ' 6 | `He's going out of harm's way, I tell you,' answered Shagrat. 'See? 7 | He's precious. I don't trust all my lads, and none of yours; nor you 8 | neither, when you're mad for fun. He's going where I want him, and where you 9 | won't come, if you don't keep civil. Up to the top, I say. He'll be safe 10 | there.' 11 | `Will he?' said Sam. 'You're forgetting the great big elvish warrior 12 | that's loose!' And with that he raced round the last corner, only to find 13 | that by some trick of the tunnel, or of the hearing which the Ring gave him, 14 | he had misjudged the distance. 15 | The two orc-figures were still some way ahead. He could see them now, 16 | black and squat against a red glare. The passage ran straight at last, up an 17 | incline; and at the end, wide open, were great double doors, leading 18 | probably to deep chambers far below the high horn of the tower. Already the 19 | Orcs with their burden had passed inside. Gorbag and Shagrat were drawing 20 | near the gate. 21 | Sam heard a burst of hoarse singing, blaring of horns and banging of 22 | gongs, a hideous clamour. Gorbag and Shagrat were already on the threshold. 23 | Sam yelled and brandished Sting, but his little voice was drowned in 24 | the tumult. No one heeded him. 25 | The great doors slammed to. Boom. The bars of iron fell into place 26 | inside. Clang. The gate was shut. Sam hurled himself against the bolted 27 | brazen plates and fell senseless to the ground. He was out in the darkness. 28 | Frodo was alive but taken by the Enemy. 29 | Here ends the second part of the history of the War of the Ring. 30 | The third part tells of the last defence against the Shadow, and the 31 | . 32 | end of the mission of the Ring-bearer in THE RETURN OF THE KING 33 | -------------------------------------------------------------------------------- /mm/viz/Metromaps_Website_files/helpers.js: -------------------------------------------------------------------------------- 1 | /************************** 2 | Map: Helpers 3 | **************************/ 4 | 5 | var _panelWidth = 2000; 6 | 7 | function setLineProperties() { 8 | for (var l in lines) { 9 | var nodeIDs = lines[l].nodeIDs; 10 | var nodeData = []; 11 | for (var n in nodeIDs) { 12 | var node = getNodeByID(nodeIDs[n]); 13 | nodeData.push(node); 14 | } 15 | nodeData = sortByDate(nodeData); 16 | var sortedNodeIDs = []; 17 | for (var n in nodeData) { 18 | sortedNodeIDs.push(nodeData[n].id); 19 | } 20 | lines[l].nodeIDs = sortedNodeIDs; 21 | } 22 | } 23 | 24 | function setNodeProperties() { 25 | nodes = sortByDate(nodes); 26 | 27 | var dateSortedNodes = sortByDate(nodes); 28 | 29 | for (var n in nodes) { 30 | nodes[n].importance = Math.floor(Math.random()*3 + 1); 31 | nodes[n].radius = nodes[n].importance * 23; 32 | nodes[n].color = colors[nodes[n].lineIDs[0]]; 33 | 34 | if (nodes[n].importance == 1) { 35 | nodes[n].displayText = "..."; 36 | } 37 | else { 38 | nodes[n].displayText = nodes[n].label; 39 | } 40 | } 41 | } 42 | 43 | function sortByDate(nodes) { 44 | var sortedNodes = nodes.sort(function(a,b){ 45 | return (Date.parse(a.time) - Date.parse(b.time)); 46 | }); 47 | return sortedNodes; 48 | } 49 | 50 | function getPanelWidth() { 51 | return _panelWidth; 52 | } 53 | 54 | function setPanelWidth(newWidth) { 55 | _panelWidth = newWidth; 56 | } 57 | 58 | function getPanelHeight() { 59 | return 400; 60 | } 61 | 62 | function getNodeByID(id) { 63 | for (var n in nodes) { 64 | if (nodes[n].id == id) { 65 | return nodes[n]; 66 | } 67 | } 68 | return null; 69 | } 70 | 71 | function getLineById(lineId) { 72 | for (var l in lines) { 73 | if (lines[l].id == lineId) { 74 | return lines[l]; 75 | } 76 | } 77 | } 78 | 79 | function initializeColors() { 80 | var numLines = lines.length; 81 | var colorArray = Util.getColorArray(numLines); 82 | colors = {}; 83 | 84 | var i = 0; 85 | for (var l in lines) { 86 | var lineID = lines[l].id; 87 | colors[lineID] = colorArray[i]; 88 | i++; 89 | } 90 | } -------------------------------------------------------------------------------- /mm/default.yaml: -------------------------------------------------------------------------------- 1 | global: &GLOBALS 2 | log_level: 'debug' 3 | doc_metadata: SPECIFY #FILL OUT 4 | mm_standard_input: /tmp/mm_input.json 5 | 6 | 7 | input_helper: 8 | <<: *GLOBALS 9 | mode: on 10 | name: whitelistcounter 11 | encoding: UTF-8 12 | in_encoding: cp1252 13 | whitelist: specify_your_whitelist_file_here # FILL OUT example: domains/lotr/data/whitelist.txt (new-line separated) 14 | blacklist: specify_your_blacklist_here # Required if choosing blacklistcounter 15 | discard_frequency: 1 # Required if blacklistcounter 16 | input_directory: split_input_files_here # FILL OUT example: domains/lotr/data/rawtext 17 | 18 | 19 | 20 | # output_json contains a list of clusters (a dictionary): 21 | # - index, cluster_start_date, cluster_end_date, doc_data 22 | # - doc_data: {"tokens": [{tfidf,plaintext,token_doc_count,id}], "doc_metadata": {timestamp,id,name} 23 | # This might be grounds for optimization 24 | slicing: 25 | <<: *GLOBALS 26 | mode: on 27 | output_dir: /tmp/query_result 28 | doc_metadata: specify_doc_metadata_here ## FILL OUT 29 | num_timeslices: 20 30 | output_json: &score_JSON /tmp/legacy_handler_out.json 31 | choose_representative_token: on 32 | 33 | 34 | clustering: 35 | <<: *GLOBALS 36 | mode: on 37 | input_json: *score_JSON 38 | similarity_merge: 1 # / above this limit merges 39 | dilution_merge: 0 # only <= below this number is merged. This is percentage of new terms that can be added 40 | min_freq_in_doc: 0 41 | tfidf_accept: 0 42 | max_tokens_per_doc: 50 43 | output_json: &clusters_JSON /tmp/clusters.json 44 | 45 | graphing: off 46 | out_graph_dir: /tmp/timeslice_graphs/ 47 | # Remove the following when cleaning project 48 | out_legacy_dir: /tmp/clusters/clusters 49 | 50 | mapgen: 51 | <<: *GLOBALS 52 | mode: on 53 | cluster_dir: /tmp/clusters 54 | raw_lines: /tmp/raw_lines 55 | line_descriptions: /tmp/line_descriptions 56 | chosen_lines: /tmp/final_lines.mm 57 | chosen_docs_for_map: final_map.mm 58 | 59 | vizbuilder: 60 | <<: *GLOBALS 61 | mode: on 62 | name: clusterdescription 63 | input_lines: final_map.mm 64 | final_map_json: final_map.json 65 | producehtml: on 66 | website_output_dir: . #directory to which web files will be stored 67 | webpage_name: Metro.html 68 | 69 | -------------------------------------------------------------------------------- /domains/test/test_data_clustering.json: -------------------------------------------------------------------------------- 1 | [{ 2 | "cluster_end_date": "20130230", 3 | "cluster_start_date": "20130201", 4 | "doc_data": [ 5 | { 6 | "doc_metadata": { 7 | "id": "55", 8 | "name": "55.txt", 9 | "timestamp": "55" 10 | }, 11 | "tokens": [ 12 | { 13 | "id": "11", 14 | "plaintext": "Gandalf", 15 | "tfidf": 1.089861468254667, 16 | "token_doc_count": 6 17 | }, 18 | { 19 | "id": "24", 20 | "plaintext": "Peregrin", 21 | "tfidf": 1.5845941303058504, 22 | "token_doc_count": 1 23 | }, 24 | { 25 | "id": "21", 26 | "plaintext": "Gimli", 27 | "tfidf": 1.3875268396577456, 28 | "token_doc_count": 2 29 | } 30 | ] 31 | }, 32 | { 33 | "doc_metadata": { 34 | "id": "1", 35 | "name": "1.txt", 36 | "timestamp": "1" 37 | }, 38 | "tokens": [ 39 | { 40 | "id": "1", 41 | "plaintext": "Bilbo", 42 | "tfidf": 4.033365187411595, 43 | "token_doc_count": 14 44 | }, 45 | { 46 | "id": "3", 47 | "plaintext": "Frodo", 48 | "tfidf": 0.9744660008545832, 49 | "token_doc_count": 12 50 | }, 51 | { 52 | "id": "2", 53 | "plaintext": "Baggins", 54 | "tfidf": 5.437770325270332, 55 | "token_doc_count": 9 56 | }, 57 | { 58 | "id": "5", 59 | "plaintext": "Sam", 60 | "tfidf": 0.4063984400586366, 61 | "token_doc_count": 1 62 | }, 63 | { 64 | "id": "4", 65 | "plaintext": "Gamgee", 66 | "tfidf": 2.552216271653552, 67 | "token_doc_count": 2 68 | } 69 | ] 70 | } 71 | ] 72 | 73 | }] -------------------------------------------------------------------------------- /mm/mapgen/get_words_of_line.py: -------------------------------------------------------------------------------- 1 | import math 2 | import sys 3 | 4 | '''THIS FILE IS NO LONGER IMPORTANT, IE WE HAVE ANOTHER WAY OF CHOOSING 5 | THE WORDS OF THE LINES THAT COMES LATER. HOWEVER, TO PRESERVE THE 6 | FORMATTING FOR FUTURE PARTS OF THE PIPELINE, WE ARE LEAVING THIS FILE IN. 7 | 8 | THIS MEANS YOU MAY DELETE THIS FILE & ELIMINATE THIS STEP OF THE PIPELINE 9 | AS LONG AS YOU ARE SURE TO CHANGE THE FILE FORMAT FOR ALL THE FILES DOWN- 10 | STREAM.''' 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | # infile = "candidateLines.txt" 19 | # outfile = "candidateLinesWithWords.txt" 20 | if __name__=='__main__': 21 | infile = sys.argv[1] 22 | outfile = sys.argv[2] 23 | main(infile, outfile) 24 | 25 | def main(infile, outfile): 26 | clusterid_cluster = {} #keys: clusterids values: clusters (set of words) 27 | #allLines = [] #each entry is a line, ie a set of clusterids 28 | 29 | CUTOFF_PERCENTAGE = .3 30 | 31 | def getWords(line): 32 | linewords = set([]) #this will store all lines that the word contains 33 | for clusterid in line: 34 | cluster = clusterid_cluster[clusterid] 35 | for word in cluster: 36 | linewords.add(word) 37 | scores = [] 38 | for word in linewords: 39 | wordscore = 0 40 | for clusterid in line: 41 | cluster = clusterid_cluster[clusterid] 42 | if word in cluster: 43 | wordscore+=1 44 | if wordscore > len(line)*CUTOFF_PERCENTAGE: 45 | scores.append((wordscore, word)) 46 | scores.sort() 47 | scores = scores[::-1] #get high->low scores. 48 | MAX_ALLOWED_WORDS = 2*int(math.sqrt(len(linewords))) #allow somewhat more words for longer lines 49 | scores = scores[:MAX_ALLOWED_WORDS] 50 | return_words = [] 51 | for pair in scores: 52 | return_words.append(pair[1]) 53 | return return_words 54 | 55 | f = open(infile) 56 | out = open(outfile, 'w') 57 | #out.write(f.readline()) #skip query 58 | out.write(f.readline()) #skip number of lines 59 | out.write(f.readline()) # skip newline 60 | 61 | 62 | while(True): #for each line 63 | mapline = set([]) #set of clusterids 64 | toWrite = [] 65 | toWrite.append(f.readline()) #skip the line importance 66 | while(True): #for each cluster in the line 67 | fileline = f.readline() 68 | toWrite.append(fileline) 69 | if len(fileline.split()) < 2: #done with a mapline 70 | break 71 | fileline = fileline.split() 72 | clusterid = fileline[0] 73 | cluster = set([]) 74 | for word in fileline[1:]: 75 | cluster.add(word) 76 | clusterid_cluster[clusterid] = cluster 77 | mapline.add(clusterid) 78 | if fileline=="": #eof 79 | break 80 | lineWords = getWords(mapline) 81 | for word in lineWords: 82 | out.write(word+" ") 83 | out.write("\n") 84 | for writeline in toWrite: 85 | out.write(writeline) 86 | f.close() 87 | out.close() 88 | 89 | 90 | 91 | -------------------------------------------------------------------------------- /domains/lotr/data/rawtext/210.txt: -------------------------------------------------------------------------------- 1 | Here ends the first part of the history of the War of the Ring. 2 | The second part is called THE TWO TOWERS , since the events recounted 3 | in it are dominated by ORTHANC , the citadel of Saruman, and the fortress 4 | of MINAS MORGUL that guards the secret entrance to Mordor; it tells of 5 | the deeds and perils of all the members of the now sundered fellowship, until 6 | the coming of the Great Darkness. 7 | The third part tells of the last defence against the Shadow, and the 8 | end of the mission of the Ring-bearer in THE RETURN OF THE KING. 9 | * BOOK III * 10 | Chapter 1. The Departure of Boromir 11 | Aragorn sped on up the hill. Every now and again he bent to the ground. 12 | Hobbits go light, and their footprints are not easy even for a Ranger to 13 | read, but not far from the top a spring crossed the path, and in the wet 14 | earth he saw what he was seeking. 15 | 'I read the signs aright,' he said to himself. 'Frodo ran to the 16 | hill-top. I wonder what he saw there? But he returned by the same way, and 17 | went down the hill again.' 18 | Aragorn hesitated. He desired to go to the high seat himself, hoping to 19 | see there something that would guide him in his perplexities; but time was 20 | pressing. Suddenly he leaped forward, and ran to the summit, across the 21 | great flag-stones, and up the steps. Then sitting in the high seat he looked 22 | out. But the sun seemed darkened, and the world dim and remote. He turned 23 | from the North back again to North, and saw nothing save the distant hills, 24 | unless it were that far away he could see again a great bird like an eagle 25 | high in the air, descending slowly in wide circles down towards the earth. 26 | Even as he gazed his quick ears caught sounds in the woodlands below, 27 | on the west side of the River. He stiffened. There were cries, and among 28 | them, to his horror, he could distinguish the harsh voices of Orcs. Then 29 | suddenly with a deep-throated call a great horn blew, and the blasts of it 30 | smote the hills and echoed in the hollows, rising in a mighty shout above 31 | the roaring of the falls. 32 | 'The horn of Boromir!' he cried. 'He is in need!' He sprang down the 33 | steps and away, leaping down the path. 'Alas! An ill fate is on me this day, 34 | and all that I do goes amiss. Where is Sam?' 35 | As he ran the cries came louder, but fainter now and desperately the 36 | horn was blowing. Fierce and shrill rose the yells of the Orcs, and suddenly 37 | the horn-calls ceased. Aragorn raced down the last slope, but before he 38 | could reach the hill's foot, the sounds died away; and as he turned to the 39 | left and ran towards them they retreated, until at last he could hear them 40 | no more. Drawing his bright sword and crying Elendil! Elendil! he crashed 41 | through the trees. 42 | -------------------------------------------------------------------------------- /mm/viz/Metromaps_Website_files/layout.js: -------------------------------------------------------------------------------- 1 | function setLayout() { 2 | setXPos(); 3 | setYPos(); 4 | } 5 | 6 | function setXPos() { 7 | var resize = 60 * nodes.length; 8 | if (resize > getPanelWidth()) { 9 | setPanelWidth(resize); 10 | } 11 | var spacing = getPanelWidth()/(nodes.length+2); 12 | var currentPos = getPanelWidth()/(nodes.length+2); 13 | 14 | //nodes are sorted by date at this point (done in setNodeProperties) 15 | for (var i = 0; i < nodes.length; i++) { 16 | nodes[i].x = currentPos; 17 | currentPos += spacing; 18 | } 19 | } 20 | 21 | function setYPos() { 22 | 23 | var lineIds = lines.map(function(lineObj){ return lineObj.id;}); 24 | if (lineIds.length > 1) { 25 | var possibleOrderings = permute(lineIds, [], []); 26 | var optimalOrdering = findOptimalOrder(possibleOrderings); 27 | } 28 | else { 29 | var optimalOrdering = lineIds; 30 | } 31 | var spacing = getPanelHeight()/(lines.length + 1); 32 | var currentPos = getPanelHeight()/(lines.length + 1); 33 | var lineYs = {}; 34 | 35 | for (var i = 0; i < optimalOrdering.length; i++) { 36 | var lineNumber = optimalOrdering[i]; 37 | lineYs[lineNumber] = currentPos; 38 | currentPos += spacing; 39 | } 40 | 41 | // Assign Y values to each node, average of the lines it is on 42 | for (var n in nodes) { 43 | var myYSum = 0; 44 | var myLines = nodes[n].lineIDs; 45 | for (var l in myLines) { 46 | var currLine = myLines[l]; 47 | myYSum += lineYs[currLine]; 48 | }// Give each ordering a score based on how many nodes they share 49 | 50 | var myYAverage = myYSum / myLines.length; 51 | nodes[n].y = myYAverage; 52 | } 53 | } 54 | 55 | // Recursively find all orderings of the lines 56 | function permute(input, permArr, usedChars) { 57 | var i, ch; 58 | for (i = 0; i < input.length; i++) { 59 | ch = input.splice(i, 1)[0]; 60 | usedChars.push(ch); 61 | if (input.length == 0) { 62 | permArr.push(usedChars.slice()); 63 | } 64 | permute(input, permArr, usedChars); 65 | input.splice(i, 0, ch); 66 | usedChars.pop(); 67 | } 68 | return permArr; 69 | }; 70 | 71 | function findOptimalOrder(possibleOrderings) { 72 | var highestScore = 0; 73 | if (possibleOrderings.length > 0) { 74 | var highestOrder = possibleOrderings[0]; 75 | } 76 | for (var order in possibleOrderings) { 77 | var orderIntersections = getOrderIntersections(possibleOrderings[order]); 78 | if (orderIntersections > highestScore) { 79 | highestScore = orderIntersections; 80 | highestOrder = possibleOrderings[order]; 81 | } 82 | } 83 | return highestOrder; 84 | } 85 | 86 | function getOrderIntersections(order) { 87 | var intersections = 0; 88 | for (var i = 1; i < order.length; i++) { 89 | var line = getLineById(parseInt(order[i])); 90 | var prevLine = getLineById(parseInt(order[i - 1])); 91 | 92 | var nodeIDs = line.nodeIDs; 93 | var prevLineNodeIDs = prevLine.nodeIDs; 94 | 95 | for (var r = 0; r < nodeIDs.length; r++) { 96 | for(var s = 0; s < prevLineNodeIDs.length; s++) { 97 | if (parseInt(nodeIDs[r]) == parseInt(prevLineNodeIDs[s])) { 98 | intersections++; 99 | } 100 | } 101 | } 102 | } 103 | return intersections; 104 | } -------------------------------------------------------------------------------- /mm/viz/Metromaps_Website_files/tile.css: -------------------------------------------------------------------------------- 1 | * { 2 | -webkit-box-sizing: border-box; 3 | -moz-box-sizing: border-box; 4 | box-sizing: border-box; 5 | } 6 | 7 | .masonry { 8 | max-width: 100%; 9 | color: #fff 10 | } 11 | 12 | .importance1 { 13 | font-size: 1.25em; 14 | 15 | } 16 | 17 | .importance2 { 18 | font-size:1.25em; 19 | } 20 | 21 | .importance3 { 22 | font-size:1.5em; 23 | } 24 | 25 | .importance4 { 26 | font-size:1.5em; 27 | } 28 | .importance5 { 29 | font-size:1.75em; 30 | } 31 | 32 | .masonry .item { 33 | float: left; 34 | } 35 | 36 | /* item is invisible, but used for layout */ 37 | .item, 38 | .item-content { 39 | width: 60px; 40 | height: 60px; 41 | } 42 | 43 | .item { 44 | border: none; 45 | background: transparent; 46 | } 47 | 48 | /* item-content is visible, and transitions size */ 49 | .item-content { 50 | padding: 30px; 51 | display:table; 52 | position:relative; 53 | width: 60px; 54 | height: 60px; 55 | background: #3fb8e8; 56 | border: 1px solid #333; 57 | border-color: hsla(0, 100%, 100%, 0.5); 58 | border-radius: 1px; 59 | -webkit-transition: width 0.4s, height 0.4s; 60 | -moz-transition: width 0.4s, height 0.4s; 61 | -o-transition: width 0.4s, height 0.4s; 62 | transition: width 0.4s, height 0.4s; 63 | } 64 | 65 | .item-content .title{ 66 | display: table-cell; 67 | vertical-align: middle; 68 | text-align: center; 69 | } 70 | 71 | .item-content .timestamp{ 72 | font-size: 0.5em; 73 | } 74 | 75 | .item-content .publisher{ 76 | font-size: 0.5em; 77 | } 78 | 79 | .item-content .previewText { 80 | padding: 0.5em; 81 | position: absolute; 82 | bottom:0; 83 | font-size: 0.75em; 84 | text-indent:50px; 85 | font-style: italic; 86 | margin: 10px; 87 | line-height: 14px; 88 | text-align:justify; 89 | } 90 | 91 | .item-content .previewText { 92 | padding: 0.5em; 93 | position: absolute; 94 | bottom:0; 95 | font-size: 0.75em; 96 | text-indent:50px; 97 | font-style: italic; 98 | margin: 10px; 99 | line-height: 14px; 100 | text-align:justify; 101 | } 102 | 103 | .article-background-pic { 104 | position: absolute; 105 | opacity: 0.15; 106 | 107 | } 108 | 109 | .item:hover .article-background-pic { 110 | 111 | background: #1baae3; 112 | cursor: pointer; 113 | } 114 | 115 | .article-background-pic:hover { 116 | opacity:0.25; 117 | background: #1baae3; 118 | cursor: pointer; 119 | } 120 | 121 | 122 | /* for flat design button*/ 123 | .demo-pricing { 124 | margin-top: 10px; 125 | margin-right: 10px; 126 | padding: 14px 26px; 127 | font-size: 14px; 128 | line-height: 100%; 129 | color: #fff; 130 | display:inline-block; 131 | vertical-align: middle; 132 | text-align: center; 133 | cursor: pointer; 134 | font-weight: bold; 135 | transition: background 0.1s ease-in-out; 136 | -webkit-transition: background 0.1s ease-in-out; 137 | -moz-transition: background 0.1s ease-in-out; 138 | -ms-transition: background 0.1s ease-in-out; 139 | -o-transition: background 0.1s ease-in-out; 140 | text-shadow: 0 1px rgba(0, 0, 0, 0.3); 141 | color: #fff; 142 | -webkit-border-radius: 3px; 143 | -moz-border-radius: 3px; 144 | border-radius: 3px; 145 | } 146 | .demo-pricing:active { 147 | padding-top: 15px; 148 | margin-bottom: -1px; 149 | } 150 | .demo-pricing, .demo-pricing:hover, .demo-pricing:active { 151 | outline: 0 none; 152 | text-decoration: none; 153 | color: #fff; 154 | } 155 | 156 | .demo-pricing-1 { 157 | background-color: #3fb8e8; 158 | } 159 | .demo-pricing-1:hover { 160 | background-color: #1baae3; 161 | } 162 | .demo-pricing-1:active { 163 | box-shadow: 0px 1px 0px 0px #3293ba; 164 | } 165 | -------------------------------------------------------------------------------- /domains/lotr/data/output/tokens.txt: -------------------------------------------------------------------------------- 1 | // labID stemID tokID token 2 | 9 14 149 aragorn 3 | 0 0 0 bilbo 4 | 0 3 162 frodo 5 | 0 4 70 sam 6 | 0 5 157 merri 7 | 0 8 143 pippin 8 | 9 21 123 peregrin 9 | 0 9 29 gandalf 10 | 0 10 178 tom 11 | 9 26 59 radagast 12 | 0 16 163 orc 13 | 0 19 114 legola 14 | 0 21 144 peregrin 15 | 8 32 110 treebeard 16 | 0 29 147 thjoden 17 | 9 9 73 gandalf 18 | 0 28 125 jomer 19 | 1 2 3 baggins 20 | 0 30 164 ent 21 | 1 1 1 baggin 22 | 9 8 76 pippin 23 | 10 14 64 aragorn 24 | 1 9 146 gandalf 25 | 1 7 15 troll 26 | 10 22 151 meriadoc 27 | 1 18 41 gim 28 | 10 29 166 thjoden 29 | 1 16 33 orc 30 | 9 30 111 ent 31 | 1 19 42 legola 32 | 1 24 134 gollum 33 | 1 30 105 ent 34 | 2 0 2 bilbo 35 | 2 5 8 merri 36 | 1 33 131 wormtongu 37 | 2 4 6 sam 38 | 2 3 4 frodo 39 | 11 24 141 gollum 40 | 2 10 17 tom 41 | 2 11 21 glorfindel 42 | 2 12 22 elrond 43 | 2 13 24 sauron 44 | 1 35 132 orcs 45 | 2 6 10 strider 46 | 2 7 14 troll 47 | 2 8 12 pippin 48 | 11 17 168 arwen 49 | 2 9 16 gandalf 50 | 12 3 179 frodo 51 | 2 18 75 gim 52 | 2 20 43 boromir 53 | 11 29 169 thjoden 54 | 2 21 68 peregrin 55 | 2 14 30 aragorn 56 | 11 27 100 fangorn 57 | 2 15 27 bombadil 58 | 2 16 37 orc 59 | 2 17 38 arwen 60 | 10 36 165 faramir 61 | 2 27 72 fangorn 62 | 11 8 153 pippin 63 | 2 26 60 radagast 64 | 3 0 48 bilbo 65 | 2 29 96 thjoden 66 | 2 28 94 jomer 67 | 2 23 47 denethor 68 | 2 22 91 meriadoc 69 | 2 25 52 saruman 70 | 2 24 51 gollum 71 | 2 34 120 jowyn 72 | 3 5 13 merri 73 | 2 37 154 angmar 74 | 3 8 81 pippin 75 | 2 36 136 faramir 76 | 3 7 11 troll 77 | 11 14 67 aragorn 78 | 2 31 101 uruk-hai 79 | 2 30 103 ent 80 | 2 33 119 wormtongu 81 | 11 9 66 gandalf 82 | 3 4 71 sam 83 | 2 32 102 treebeard 84 | 3 3 5 frodo 85 | 3 16 82 orc 86 | 3 13 117 sauron 87 | 12 27 108 fangorn 88 | 3 14 31 aragorn 89 | 3 11 34 glorfindel 90 | 3 12 39 elrond 91 | 2 38 174 goldberri 92 | 3 9 32 gandalf 93 | 3 23 152 denethor 94 | 12 32 107 treebeard 95 | 3 24 85 gollum 96 | 3 21 44 peregrin 97 | 3 22 45 meriadoc 98 | 12 29 116 thjoden 99 | 3 20 46 boromir 100 | 3 17 36 arwen 101 | 3 18 74 gim 102 | 12 8 135 pippin 103 | 3 32 129 treebeard 104 | 4 3 84 frodo 105 | 12 9 121 gandalf 106 | 4 2 7 baggins 107 | 12 10 175 tom 108 | 4 1 145 baggin 109 | 3 30 106 ent 110 | 3 29 98 thjoden 111 | 12 4 137 sam 112 | 3 28 126 jomer 113 | 3 27 113 fangorn 114 | 3 25 63 saruman 115 | 3 38 176 goldberri 116 | 3 36 138 faramir 117 | 3 34 124 jowyn 118 | 12 14 90 aragorn 119 | 3 33 172 wormtongu 120 | 4 16 155 orc 121 | 4 19 83 legola 122 | 4 18 93 gim 123 | 4 30 99 ent 124 | 12 36 139 faramir 125 | 5 6 9 strider 126 | 6 0 35 bilbo 127 | 5 28 95 jomer 128 | 6 12 23 elrond 129 | 6 13 53 sauron 130 | 6 10 180 tom 131 | 6 16 92 orc 132 | 6 14 25 aragorn 133 | 6 4 86 sam 134 | 6 5 78 merri 135 | 6 3 20 frodo 136 | 6 8 80 pippin 137 | 6 9 40 gandalf 138 | 6 6 26 strider 139 | 5 36 160 faramir 140 | 6 7 18 troll 141 | 6 30 171 ent 142 | 6 33 173 wormtongu 143 | 7 4 69 sam 144 | 6 32 109 treebeard 145 | 7 3 28 frodo 146 | 6 27 87 fangorn 147 | 6 26 62 radagast 148 | 6 29 97 thjoden 149 | 7 0 56 bilbo 150 | 6 28 128 jomer 151 | 6 23 142 denethor 152 | 6 22 156 meriadoc 153 | 6 25 61 saruman 154 | 6 24 54 gollum 155 | 6 19 89 legola 156 | 6 18 77 gim 157 | 6 20 49 boromir 158 | 7 18 88 gim 159 | 7 20 50 boromir 160 | 7 13 55 sauron 161 | 7 14 161 aragorn 162 | 7 16 112 orc 163 | 6 38 177 goldberri 164 | 7 9 57 gandalf 165 | 7 10 130 tom 166 | 7 12 65 elrond 167 | 6 34 148 jowyn 168 | 6 36 140 faramir 169 | 7 7 19 troll 170 | 7 8 79 pippin 171 | 7 36 159 faramir 172 | 7 34 150 jowyn 173 | 7 33 122 wormtongu 174 | 7 32 170 treebeard 175 | 7 30 104 ent 176 | 7 29 127 thjoden 177 | 7 28 118 jomer 178 | 7 25 115 saruman 179 | 7 24 133 gollum 180 | 7 23 158 denethor 181 | 8 19 58 legola 182 | 8 12 167 elrond 183 | -------------------------------------------------------------------------------- /mm/mapgen/timeslice.py: -------------------------------------------------------------------------------- 1 | # from cluster import * 2 | 3 | class TimeSlice(): 4 | totals = {} 5 | non_repeating_totals = {} 6 | time_to_timeslice = {} 7 | total_clusters = 0 8 | 9 | @classmethod 10 | def get_wordcount_by_time(cls, time, word=None): 11 | if word: 12 | count = 0 13 | for i in range(time): 14 | timeslice = TimeSlice.time_to_timeslice[i] 15 | if word in timeslice.words_in_timeslice: 16 | count += 1 17 | 18 | return count 19 | else: 20 | counts = {} 21 | for i in range(time): 22 | timeslice = TimeSlice.time_to_timeslice[i] 23 | for word in timeslice.words_in_timeslice: 24 | counts[word] = counts[word] + 1 if word in counts else 1 25 | return counts 26 | 27 | @classmethod 28 | def get_total_count(cls, word): 29 | return TimeSlice.totals[word] if word in TimeSlice.totals else 0 30 | 31 | 32 | def __init__(self, lines, time, filename): 33 | self.filename = filename 34 | self.time = time 35 | self.words_in_timeslice = set() 36 | 37 | self.clusters = [] 38 | for i, line in enumerate(lines): 39 | self.clusters += [Cluster(line, self, i)] 40 | 41 | self.time_counts = {} 42 | for cluster in self.clusters: 43 | for word in cluster.words: 44 | self.words_in_timeslice.add(word) 45 | TimeSlice.totals[word] = TimeSlice.totals[word]+1 if word in TimeSlice.totals else 1 46 | self.time_counts[word] = self.time_counts[word]+1 if word in self.time_counts else 1 47 | TimeSlice.total_clusters += len(self.clusters) 48 | for word in self.words_in_timeslice: 49 | TimeSlice.non_repeating_totals[word] = TimeSlice.non_repeating_totals[word]+1 if word in TimeSlice.non_repeating_totals else 1 50 | 51 | TimeSlice.time_to_timeslice[time] = self 52 | 53 | 54 | def __str__(self): 55 | clusters_str = [filename] 56 | for cluster in self.clusters: 57 | clusters_str += [str(cluster)] 58 | 59 | return '\n'.join(clusters_str) 60 | 61 | def isUnique(self,word): 62 | return (self.time_counts[word] - TimeSlice.totals[word] == 0) 63 | 64 | def prune_clusters(self): 65 | to_consider = {} 66 | 67 | for cluster in self.clusters: 68 | for word in cluster.words: 69 | if TimeSlice.totals[word] == self.time_counts[word] and TimeSlice.totals[word] > 1: 70 | if word not in to_consider : to_consider[word] = [] 71 | to_consider[word] += cluster.words 72 | 73 | for to_prune in to_consider.values: 74 | print 'pruning ' + str(to_prune) 75 | print 'into one: ' + '[not implemented yet, just wanted to see the need]' 76 | 77 | 78 | 79 | class Cluster(): 80 | def __init__(self, line, timeslice, uniqueid): 81 | if type(line) == type(str()): 82 | self.words = line.split()[2:] 83 | else: 84 | self.words = line 85 | self.timeslice = timeslice 86 | self.uniqueid = uniqueid 87 | 88 | def __len__(self): 89 | return len(self.words) 90 | 91 | def __mul__(self, other): 92 | return [self] * other 93 | 94 | def __rmul__(self, other): 95 | return self.__mul__(other) 96 | 97 | def __str__(self): 98 | # with_counts =map(lambda word: ('(%s/%s) =%s' % \ 99 | # (str(self.timeslice.time_counts[word]), str(TimeSlice.totals[word]), word)), self.words) 100 | 101 | # return "Time "+ str(self.timeslice.time) + "-- " + " ".join(with_counts) 102 | return self.timeslice.filename +'_'+ str(self.uniqueid) + " " + (" ".join(self.words)) 103 | 104 | def union(self, other): 105 | return set(self.words).union(set(other.words)) 106 | 107 | def intersection(self, other): 108 | return set(self.words).intersection(set(other.words)) 109 | 110 | def get_without_unique(self): 111 | return Cluster((filter(lambda word: \ 112 | not self.timeslice.isUnique(word), self.words)), self.timeslice, self.uniqueid) 113 | -------------------------------------------------------------------------------- /mm/viz/Metromaps_Website_files/eventhandlers.js: -------------------------------------------------------------------------------- 1 | /************************** 2 | Map: Event handling 3 | **************************/ 4 | 5 | function addEventHandlersToButton(){ 6 | $("#example1-btn").on('click', function(event){ 7 | updateJSON(finalJson); 8 | }); 9 | $("#example2-btn").on('click', function(event){ 10 | updateJSON(finalJson2); 11 | 12 | }); 13 | $("#example3-btn").on('click', function(event){ 14 | updateJSON(finalJson3); 15 | }); 16 | $("#example4-btn").on('click', function(event){ 17 | updateJSON(finalJson4); 18 | }); 19 | $("#example5-btn").on('click', function(event){ 20 | updateJSON(finalJson5); 21 | }); 22 | 23 | } 24 | 25 | function stagePan(object) { 26 | object.on('mouseover', function() { 27 | document.body.style.cursor = '-webkit-grab'; 28 | }); 29 | object.on('dragmove', function() { 30 | //only allow horizontal scrolling 31 | object.setY(0); 32 | 33 | // constrain left and right panning 34 | if (object.getX() > 0) { 35 | object.setX(0); 36 | } 37 | var offset = (-1) * (getPanelWidth() - $('#map-container').width()); 38 | if (object.getX() < offset) { 39 | object.setX(offset); 40 | } 41 | 42 | object.draw(); 43 | }); 44 | } 45 | 46 | function nodeHover(object, node) { 47 | var nodeLabel = node.labelShape; 48 | var nodeCircle = node.circleShape; 49 | 50 | object.on('mouseenter', function() { 51 | // highlight color 52 | if (node.id != currentSelectedNode) { 53 | darkenColor(node); 54 | } 55 | // magnify small nodes 56 | if (node.importance == 1) { 57 | magnify(node); 58 | } 59 | // change cursor to pointer 60 | document.body.style.cursor = 'pointer'; 61 | // bring to front 62 | nodeCircle.moveToTop(); 63 | nodeLabel.moveToTop(); 64 | 65 | layer.draw(); 66 | }); 67 | object.on('mouseleave', function() { 68 | if (node.id != currentSelectedNode) { 69 | lightenColor(node); 70 | } 71 | if (node.importance == 1) { 72 | collapse(node); 73 | } 74 | document.body.style.cursor = '-webkit-grab'; 75 | layer.draw(); 76 | }); 77 | } 78 | 79 | function nodeClick(object, node) { 80 | object.on('click', function() { 81 | lightenColor(getNodeByID(currentSelectedNode)); 82 | currentSelectedNode = node.id; 83 | layer.draw(); 84 | console.log(node); 85 | populateArticles(node); 86 | }); 87 | } 88 | 89 | function magnify(node) { 90 | var circleShape = node.circleShape; 91 | circleShape.setRadius(23*3); 92 | 93 | var labelShape = node.labelShape; 94 | labelShape.setText(node.label); 95 | labelShape.setWidth(23*3*1.5); 96 | labelShape.setHeight(23*3*1.5); 97 | labelShape.setFontSize(18); 98 | labelShape.setPosition(node.x - 23*3*.75, node.y - 23*3*.75); 99 | } 100 | 101 | function collapse(node) { 102 | var circleShape = node.circleShape; 103 | circleShape.setRadius(23); 104 | 105 | var labelShape = node.labelShape; 106 | labelShape.setText("..."); 107 | labelShape.setWidth(23*1.5); 108 | labelShape.setHeight(23*1.5); 109 | labelShape.setFontSize(20); 110 | labelShape.setPosition(node.x - 23*.75, node.y - 23*.75); 111 | } 112 | 113 | function changeSelectedNode(node) { 114 | // make the previously selected node back to normal 115 | lightenColor(currentSelectedNode); 116 | 117 | // darken the new selected node 118 | currentSelectedNode = node; 119 | darkenColor(currentSelectedNode); 120 | layer.draw(); 121 | } 122 | 123 | function darkenColor(nodeData) { 124 | var firstLine = nodeData.lineIDs[0]; 125 | var circleShape = nodeData.circleShape; 126 | circleShape.setFill(Util.getHighlightedColor(colors[firstLine])); 127 | } 128 | 129 | function lightenColor(nodeData) { 130 | var firstLine = nodeData.lineIDs[0]; 131 | var circleShape = nodeData.circleShape; 132 | circleShape.setFill(colors[firstLine]); 133 | } -------------------------------------------------------------------------------- /mmrun.py: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env python2.7 2 | 3 | import argparse 4 | import mm.inputhelpers 5 | import mm.inputhelpers.factory 6 | import mm.input 7 | import mm.mapgen 8 | import mm.viz 9 | import logging 10 | import yaml 11 | import yaml.composer 12 | 13 | 14 | 15 | def Run_input_handler(configs): 16 | input_helper_configs = configs.get('input_helper') 17 | if (input_helper_configs.get('mode')): 18 | logging.debug(input_helper_configs) 19 | logging.info("Running input handler") 20 | handler_input = mm.inputhelpers.factory.ReadConfig(configs.get('input_helper')) 21 | handler_input.run() 22 | handler_input.save() 23 | else: 24 | logging.info("Skipping input handler") 25 | 26 | 27 | def Run_slicing_handler(configs): 28 | legacy_configs = configs.get('slicing') 29 | if (legacy_configs.get('mode')): 30 | logging.info("Converting to legacy format") 31 | legacy_handler = mm.input.SlicingHandler(legacy_configs) 32 | legacy_handler.write() 33 | logging.info("Legacy format written to %s" %(legacy_configs.get('output_dir'))) 34 | 35 | def Run_clustering_handler(configs): 36 | clustering_configs = configs.get('clustering',{}) 37 | if (clustering_configs.get('mode')): 38 | logging.info("Running clustering handler") 39 | clustering_handler = mm.mapgen.cluster_generator.ClusterGenerator(configs.get('clustering')) 40 | clustering_handler.run() 41 | clustering_handler.write() 42 | 43 | def Run_map_generator(configs): 44 | map_gen_configs = configs.get('mapgen') 45 | if (map_gen_configs.get('mode')): 46 | logging.info("Running map generation") 47 | mapgen_handler = mm.mapgen.legacy_generator.LegacyGenerator(map_gen_configs) 48 | mapgen_handler.run() 49 | else: 50 | logging.info('Skipping map generator') 51 | 52 | def Run_visualization(configs): 53 | viz_configs = configs.get('vizbuilder') 54 | if (viz_configs.get('mode')): 55 | logging.info("Running visualization") 56 | viz_handler = mm.viz.ReadConfig(viz_configs) 57 | viz_handler.run() 58 | else: 59 | logging.info('Skipping viz generator') 60 | 61 | def Run(configs): 62 | Run_input_handler(configs) 63 | Run_slicing_handler(configs) 64 | Run_clustering_handler(configs) 65 | Run_map_generator(configs) 66 | Run_visualization(configs) 67 | 68 | 69 | def main(config_file, defaults="mm/default.yaml"): 70 | config_dict = {} 71 | 72 | logging.basicConfig(format='%(levelname)s %(asctime)s %(message)s', level=logging.DEBUG) 73 | with open(defaults) as df: 74 | try: 75 | config_dict = yaml.load(df) 76 | except yaml.composer.ComposerError: 77 | logging.error('ERROR in yaml-reading the default config file') 78 | raise 79 | sections = config_dict.keys() 80 | with open(config_file) as cf: 81 | try: 82 | new_config = yaml.load(cf) 83 | for section in sections: 84 | sec_dict = new_config.get(section, {}) 85 | config_dict.get(section).update(sec_dict) 86 | except yaml.composer.ComposerError: 87 | logging.error('ERROR in reading the input config file') 88 | raise 89 | log_level = {'error':logging.ERROR, 'debug':logging.DEBUG}.get(config_dict.get('global',{}).get('log_level'), logging.DEBUG) 90 | 91 | logging.basicConfig(level=log_level) 92 | 93 | logging.debug('final configuration: \n%s' % (str(yaml.dump(config_dict)))) 94 | Run(config_dict) 95 | 96 | 97 | if __name__=='__main__': 98 | parser = argparse.ArgumentParser(description='Run Metromaps by specifying a config file') 99 | parser.add_argument('config_file', help='See default.yaml for configuration options') 100 | parser.add_argument('--defaults', default='mm/default.yaml', help='the default values get preloaded from this yaml configuration file') 101 | args = parser.parse_args() 102 | main(args.config_file, args.defaults) 103 | 104 | 105 | -------------------------------------------------------------------------------- /mm/viz/clusterdescription.py: -------------------------------------------------------------------------------- 1 | import logging 2 | import json 3 | import web_generator 4 | import os 5 | 6 | def construct(config): 7 | return ClusterDescriptionViz(config) 8 | 9 | class ClusterDescriptionViz(object): 10 | # def _get_node(self, cluster_line, nodes): 11 | # if len(cluster_line) == 0: 12 | # print 'done' 13 | # return None 14 | 15 | # print "Processing" + cluster_line 16 | # cluster_elements = cluster_line.split() 17 | # print cluster_elements 18 | 19 | 20 | # cluster_id = cluster_elements[0] 21 | 22 | 23 | 24 | # if cluster_id in nodes: 25 | # return nodes[cluster_id] 26 | 27 | # cluster_words = cluster_elements[1:] 28 | 29 | # node = {} 30 | # node['id'] = cluster_id 31 | # node['cluster_words'] = cluster_words 32 | # startof_date = len("clusters_") 33 | # year = cluster_id[startof_date:startof_date+4] 34 | # month = cluster_id[startof_date+4:startof_date+6] 35 | # day = cluster_id[startof_date+6:startof_date+8] 36 | # node['time'] = "%s-%s-%s" % (year, month,day) 37 | # node['label'] = " ".join(cluster_words) 38 | # nodes[cluster_id] = node 39 | 40 | 41 | 42 | # def _read_lines(self): 43 | # nodes = {} 44 | # lines = {} 45 | 46 | # with open(self.input_lines_file) as input_f: 47 | # num_total_lines = int(input_f.readline()) 48 | # input_f.readline() 49 | # for line_i in range(num_total_lines): 50 | # line = input_f.readline() 51 | # line=line.strip() 52 | # line_description = line 53 | # clusters = [] 54 | # line = input_f.readline().strip() 55 | # clusters += [self._get_node(line,nodes)] 56 | 57 | # while (len(line) != 0): 58 | # line=input_f.readline().strip() 59 | # clusters += [self._get_node(line,nodes)] 60 | # print '\n\n\nLINE\n--------------' 61 | # print line_description 62 | # print clusters 63 | # # return (nodes, lines) 64 | 65 | def _read_json_input(self): 66 | with open(self.input_lines_file) as input_f: 67 | input_json = json.load(input_f) 68 | nodes = input_json['nodes'] 69 | lines = input_json['lines'] 70 | return (nodes, lines) 71 | return None 72 | 73 | 74 | def __init__(self, config): 75 | self.input_lines_file = config['input_lines_json'] 76 | self.output = config['final_map_viz_json'] 77 | if config.get('producehtml', False): 78 | self.producehtml = True 79 | self.website_output_dir = config['website_output_dir'] 80 | self.webpage_name = config['webpage_name'] 81 | else: 82 | self.producehtml = False 83 | # creates .nodes and .lines: 84 | (self.nodes, self.lines) = self._read_json_input() 85 | 86 | def run(self): 87 | output_viz_json = {"articles": {}} 88 | out_lines = {} 89 | out_nodes = {} 90 | node_to_lines = {} 91 | for line in self.lines: 92 | line_d = {"id": line["id"], "line_label": ", ".join(line['words']), "nodeIDs": line['nodeIDs']} 93 | out_lines[str(line["id"])]= line_d 94 | for node in line['nodeIDs']: 95 | current_lines = node_to_lines.get(node, []) 96 | current_lines += [line["id"]] 97 | node_to_lines[node] = current_lines 98 | 99 | for nodeid, node in self.nodes.iteritems(): 100 | cluster_words = " ".join(node["words"]) 101 | node_d = {"id": node["id"], 102 | "articleIDs": [], "cluster_words": cluster_words, 103 | "importance": "1", "label": cluster_words, 104 | "lineIDs": node_to_lines.get(node['id'], []), 105 | "time": node["time"]} 106 | out_nodes[node["id"]] = node_d 107 | output_viz_json["nodes"] = out_nodes 108 | output_viz_json["lines"] = out_lines 109 | 110 | with open(self.output,'w') as out_f: 111 | logging.debug('viz.run: starting dump of json file') 112 | json.dump(output_viz_json, out_f) 113 | logging.debug('viz dumped to %s' % self.output) 114 | 115 | if self.producehtml: 116 | wgv = web_generator.WebGeneratorViz(self.output, self.website_output_dir, self.webpage_name) 117 | wgv.run() 118 | final_product = os.path.join(self.website_output_dir, self.webpage_name) 119 | logging.info('Preview visualization by opening %s' % final_product) 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | -------------------------------------------------------------------------------- /domains/lotr/data/rawtext/115.txt: -------------------------------------------------------------------------------- 1 | imagined opened out before him; and the firelit hall became like a golden 2 | mist above seas of foam that sighed upon the margins of the world. Then the 3 | enchantment became more and more dreamlike, until he felt that an endless 4 | river of swelling gold and silver was flowing over him, too multitudinous 5 | for its pattern to be comprehended; it became part of the throbbing air 6 | about him, and it drenched and drowned him. Swiftly he sank under its 7 | shining weight into a deep realm of sleep. 8 | There he wandered long in a dream of music that turned into running 9 | water, and then suddenly into a voice. It seemed to be the voice of Bilbo 10 | chanting verses. Faint at first and then clearer ran the words. 11 | Edrendil was a mariner 12 | that tarried in Arvernien; 13 | he built a boat of timber felled 14 | in Nimbrethil to journey in; 15 | her sails he wove of silver fair, 16 | of silver were her lanterns made, 17 | her prow was fashioned like a swan, 18 | and light upon her banners laid. 19 | In panoply of ancient kings, 20 | in chain‚d rings he armoured him; 21 | his shining shield was scored with runes 22 | to ward all wounds and harm from him; 23 | his bow was made of dragon-horn, 24 | his arrows shorn of ebony, 25 | of silver was his habergeon, 26 | his scabbard of chalcedony; 27 | his sword of steel was valiant, 28 | of adamant his helmet tall, 29 | an eagle-plume upon his crest, 30 | upon his breast an emerald. 31 | Beneath the Moon and under star 32 | he wandered far from northern strands, 33 | bewildered on enchanted ways 34 | beyond the days of mortal lands. 35 | From gnashing of the Narrow Ice 36 | where shadow lies on frozen hills, 37 | from nether heats and burning waste 38 | he turned in haste, and roving still 39 | on starless waters far astray 40 | at last he came to Night of Naught, 41 | and passed, and never sight he saw 42 | of shining shore nor light he sought. 43 | The winds of wrath came driving him, 44 | and blindly in the foam he fled 45 | from west to east and errandless, 46 | unheralded he homeward sped. 47 | There flying Elwing came to him, 48 | and flame was in the darkness lit; 49 | more bright than light of diamond 50 | the fire upon her carcanet. 51 | The Silmaril she bound on him 52 | and crowned him with the living light 53 | and dauntless then with burning brow 54 | he turned his prow; and in the night 55 | from Otherworld beyond the Sea 56 | there strong and free a storm arose, 57 | a wind of power in Tarmenel; 58 | by paths that seldom mortal goes 59 | his boat it bore with biting breath 60 | as might of death across the grey 61 | and long-forsaken seas distressed: 62 | from east to west he passed away. 63 | Through Evernight he back was borne 64 | on black and roaring waves that ran 65 | o'er leagues unlit and foundered shores 66 | that drowned before the Days began, 67 | until he heard on strands of pearl 68 | when ends the world the music long, 69 | where ever foaming billows roll 70 | the yellow gold and jewels wan. 71 | He saw the Mountain silent rise 72 | where twilight lies upon the knees 73 | of Valinor, and Eldamar 74 | beheld afar beyond the seas. 75 | A wanderer escaped from night 76 | to haven white he came at last, 77 | to Elvenhome the green and fair 78 | where keen the air, where pale as glass 79 | beneath the Hill of Ilmarin 80 | a-glimmer in a valley sheer 81 | the lamplit towers of Tirion 82 | are mirrored on the Shadowmere. 83 | He tarried there from errantry, 84 | and melodies they taught to him, 85 | and sages old him marvels told, 86 | and harps of gold they brought to him. 87 | They clothed him then in elven-white, 88 | and seven lights before him sent, 89 | as through the Calacirian 90 | to hidden land forlorn he went. 91 | He came unto the timeless halls 92 | where shining fall the countless years, 93 | and endless reigns the Elder King 94 | in Ilmarin on Mountain sheer; 95 | and words unheard were spoken then 96 | of folk of Men and Elven-kin, 97 | beyond the world were visions showed 98 | forbid to those that dwell therein. 99 | A ship then new they built for him 100 | of mithril and of elven-glass 101 | with shining prow; no shaven oar 102 | nor sail she bore on silver mast: 103 | the Silmaril as lantern light 104 | and banner bright with living flame 105 | -------------------------------------------------------------------------------- /domains/lotr/data/rawtext/209.txt: -------------------------------------------------------------------------------- 1 | bank all by itself. With a shout Sam raced across the grass. The boat 2 | slipped into the wat 3 | 128d 4 | er. 5 | `Coming, Mr. Frodo! Coming! ' called Sam, and flung himself from the 6 | bank, clutching at the departing boat. He missed it by a yard. With a cry 7 | and a splash he fell face downward into deep swift water. Gurgling he went 8 | under, and the River closed over his curly head. 9 | An exclamation of dismay came from the empty boat. A paddle swirled and 10 | the boat put about. Frodo was just in time to grasp Sam by the hair as he 11 | came up, bubbling and struggling. Fear was staring in his round brown eyes. 12 | `Up you come, Sam my lad! ' said Frodo. `Now take my hand! ' 13 | `Save me, Mr. Frodo! ' gasped Sam. `I'm drownded. I can't see your 14 | hand.' 15 | `Here it is. Don't pinch, lad! I won't let you go. Tread water and 16 | don't flounder, or you'll upset the boat. There now, get hold of the side, 17 | and let me use the paddle! ' 18 | With a few strokes Frodo brought the boat back to the bank. and Sam was 19 | able to scramble out, wet as a water-rat. Frodo took off the Ring and 20 | stepped ashore again. 21 | `Of all the confounded nuisances you are the worst, Sam! ' he said. 22 | 'Oh, Mr. Frodo, that's hard! ' said Sam shivering. `That's hard, trying 23 | to go without me and all. If I hadn't a guessed right, where would you be 24 | now? ' 25 | `Safely on my way.' 26 | `Safely! ' said Sam. `All alone and without me to help you? I couldn't 27 | have a borne it, it'd have been the death of me.' 28 | 'It would be the death of you to come with me, Sam,' said Frodo and I 29 | could not have borne that.' 30 | `Not as certain as being left behind,' said Sam. 31 | `But I am going to Mordor.' 32 | `I know that well enough, Mr. Frodo. Of course you are. And I'm coming 33 | with you.' 34 | `Now, Sam,' said Frodo, `don't hinder me! The others will be coming 35 | back at any minute. If they catch me here. I shall have to argue and 36 | explain, and I shall never have the heart or the chance to get off. But I 37 | must go at once. It's the only way.' 38 | `Of course it is,' answered Sam. 'But not alone. I'm coming too, or 39 | neither of us isn't going. I'll knock holes in all the boats first.' 40 | Frodo actually laughed. A sudden warmth and gladness touched his heart. 41 | `Leave one! 'he said. `We'll need it. But you can't come like this without 42 | your gear or food or anything.' 43 | 'Just hold on a moment, and I'll get my stuff!' cried Sam eagerly. 44 | 'It's all ready. I thought we should be off today.' He rushed to the camping 45 | place, fished out his pack from the pile where Frodo had laid it when he 46 | emptied the boat of his companions' goods grabbed a spare blanket, and some 47 | extra packages of food, and ran back. 48 | `So all my plan is spoilt! ' said Frodo. `It is no good trying to 49 | escape you. But I'm glad, Sam. I cannot tell you how glad. Come along! It is 50 | plain that we were meant to go together. We will go, and may the others find 51 | a safe road! Strider will look after them. I don't suppose we shall see them 52 | again.' 53 | `Yet we may, Mr Frodo. We may,' said Sam. 54 | So Frodo and Sam set off on the last stage of the Quest together. Frodo 55 | paddled away from the shore, and the River bore them swiftly away. down the 56 | western arm, and past the frowning cliffs of Tol Brandir. The roar of the 57 | great falls drew nearer. Even with such help as Sam could give, it was hard 58 | work to pass across the current at the southward end of the island and drive 59 | the boat eastward towards the far shore. 60 | At length they came to land again upon the southern slopes of Amon 61 | Lhaw. There they found a shelving shore, and they drew the boat out, high 62 | above the water, and hid it as well as they could behind a great boulder. 63 | Then shouldering their burdens, they set off, seeking a path that would 64 | bring them over the grey hills of the Emyn Muil, and down into the Land of 65 | Shadow. 66 | Here ends the first part of the history of the War of the Ring. 67 | The second part is called THE TWO TOWERS , since the events recounted 68 | in it are dominated by ORTHANC , the citadel of Saruman, and the fortress 69 | of MINAS MORGUL that guards the secret entrance to Mordor; it tells of 70 | the deeds and perils of all the members of the now sundered fellowship, until 71 | the coming of the Great Darkness. 72 | The third part tells of the last defence against the Shadow, and the 73 | end of the mission of the Ring-bearer in THE RETURN OF THE KING. 74 | -------------------------------------------------------------------------------- /domains/lotr/data/rawtext/389.txt: -------------------------------------------------------------------------------- 1 | * BOOK V * 2 | Chapter 1. Minas Tirith 3 | Pippin looked out from the shelter of Gandalf's cloak. He wondered if 4 | he was awake or still sleeping, still in the swift-moving dream in which he 5 | had been wrapped so long since the great ride began. The dark world was 6 | rushing by and the wind sang loudly in his ears. He could see nothing but 7 | the wheeling stars, and away to his right vast shadows against the sky where 8 | the mountains of the South marched past. Sleepily he tried to reckon the 9 | times and stages of their journey, but his memory was drowsy and uncertain. 10 | There had been the first ride at terrible speed without a halt, and 11 | then in the dawn he had seen a pale gleam of gold, and they had come to the 12 | silent town and the great empty house on the hill. And hardly had they 13 | reached its shelter when the winged shadow had passed over once again, and 14 | men wilted with fear. But Gandalf had spoken soft words to him, and he had 15 | slept in a corner, tired but uneasy, dimly aware of comings and goings and 16 | of men talking and Gandalf giving orders. And then again riding, riding in 17 | the night. This was the second, no, the third night since he had looked in 18 | the Stone. And with that hideous memory he woke fully, and shivered, and the 19 | noise of the wind became filled with menacing voices. 20 | A light kindled in the sky, a blaze of yellow fire behind dark barriers 21 | Pippin cowered back, afraid for a moment, wondering into what dreadful 22 | country Gandalf was bearing him. He rubbed his eyes, and then he saw that it 23 | was the moon rising above the eastern shadows, now almost at the full. So 24 | the night was not yet old and for hours the dark journey would go on. He 25 | stirred and spoke. 26 | 'Where are we, Gandalf?' he asked. 27 | 'In the realm of Gondor,' the wizard answered. 'The land of Anurien is 28 | still passing by.' 29 | There was a silence again for a while. Then, 'What is that?' cried 30 | Pippin suddenly, clutching at Gandalf's cloak. 'Look! Fire, red fire! Are 31 | there dragons in this land? Look, there is another!' 32 | For answer Gandalf cried aloud to his horse. 'On, Shadowfax! We must 33 | hasten. Time is short. See! The beacons of Gondor are alight, calling for 34 | aid. War is kindled. See, there is the fire on Amon Don, and flame on 35 | Eilenach; and there they go speeding west: Nardol, Erelas, Min-Rimmon, 36 | Calenhad, and the Halifirien on the borders of Rohan.' 37 | But Shadowfax paused in his stride, slowing to a walk, and then he 38 | lifted up his head and neighed. And out of the darkness the answering neigh 39 | of other horses came; and presently the thudding of hoofs was heard, and 40 | three riders swept up and passed like flying ghosts in the moon and vanished 41 | into the West. Then Shadowfax gathered himself together and sprang away, 42 | and 43 | the night flowed over him like a roaring wind. 44 | Pippin became drowsy again and paid little attention to Gandalf telling 45 | him of the customs of Gondor, and how the Lord of the City had beacons built 46 | on the tops of outlying hills along both borders of the great range, and 47 | maintained posts at these points where fresh horses were always in readiness 48 | to bear his errand-riders to Rohan in the North, or to Belfalas in the 49 | South. 'It is long since the beacons of the North were lit,' he said; 'and 50 | in the ancient days of Gondor they were not needed, for they had the Seven 51 | Stones.' Pippin stirred uneasily. 52 | 'Sleep again, and do not be afraid!' said Gandalf. 'For you are not 53 | going like Frodo to Mordor, but to Minas Tirith, and there you will be as 54 | safe as you can be anywhere in these days. If Gondor falls, or the Ring is 55 | taken, then the Shire will be no refuge.' 56 | 'You do not comfort me,' said Pippin, but nonetheless sleep crept over 57 | him. The last thing that he remembered before he fell into deep dream was a 58 | glimpse of high white peaks, glimmering like floating isles above the clouds 59 | as they caught the light of the westering moon. He wondered where Frodo was, 60 | and if he was already in Mordor, or if he was dead; and he did not know that 61 | Frodo from far away looked on that same moon as it set beyond Gondor ere the 62 | coming of the day. 63 | Pippin woke to the sound of voices. Another day of hiding and a night 64 | of journey had fleeted by. It was twilight: the cold dawn was at hand again, 65 | and chill grey mists were about them. Shadowfax stood steaming with sweat, 66 | but he held his neck proudly and showed no sign of weariness. Many tall men 67 | heavily cloaked stood beside him, and behind them in the mist loomed a wall 68 | of stone. Partly ruinous it seemed, but already before the night was passed 69 | the sound of hurried labour could be heard: beat of hammers, clink of 70 | -------------------------------------------------------------------------------- /domains/lotr/data/rawtext/434.txt: -------------------------------------------------------------------------------- 1 | bow sang. For a moment all was still. 2 | The drums rolled and rattled. With a vast rush Grond was hurled forward 3 | by huge hands. It reached the Gate. It swung. A deep boom rumbled through 4 | the City like thunder running in the clouds. But the doors of iron and posts 5 | of steel withstood the stroke. 6 | Then the Black Captain rose in his stirrups and cried aloud in a 7 | dreadful voice, speaking in some forgotten tongue words of power and terror 8 | to rend both heart and stone. 9 | Thrice he cried. Thrice the great ram boomed. And suddenly upon the 10 | last stroke the Gate of Gondor broke. As if stricken by some blasting spell 11 | it burst asunder: there was a flash of searing lightning, and the doors 12 | tumbled in riven fragments to the ground. 13 | In rode the Lord of the Nazgyl. A great black shape against the fires 14 | beyond he loomed up, grown to a vast menace of despair. In rode the Lord of 15 | the Nazgyl, under the archway that no enemy ever yet had passed, and all 16 | fled before his face. 17 | All save one. There waiting, silent and still in the space before the 18 | Gate, sat Gandalf upon Shadowfax: Shadowfax who alone among the free 19 | horses 20 | of the earth endured the terror, unmoving, steadfast as a graven image in 21 | Rath Dnnen. 22 | 'You cannot enter here,' said Gandalf, and the huge shadow halted. 'Go 23 | back to the abyss prepared for you! Go back! Fall into the nothingness that 24 | awaits you and your Master. Go!' 25 | The Black Rider flung back his hood, and behold! he had a kingly crown; 26 | and yet upon no head visible was it set. The red fires shone between it and 27 | the mantled shoulders vast and dark. From a mouth unseen there came a deadly 28 | laughter. 29 | 'Old fool!' he said. 'Old fool! This is my hour. Do you not know Death 30 | when you see it? Die now and curse in vain!' And with that he lifted high 31 | his sword and flames ran down the blade. 32 | Gandalf did not move. And in that very moment, away behind in some 33 | courtyard of the City, a cock crowed. Shrill and clear he crowed, recking 34 | nothing of wizardry or war, welcoming only the morning that in the sky far 35 | above the shadows of death was coming with the dawn. 36 | And as if in answer there came from far away another note. Horns, 37 | horns, horns. In dark Mindolluin's sides they dimly echoed. Great horns of 38 | the North wildly blowing. Rohan had come at last. 39 | Chapter 5. The Ride of the Rohirrim 40 | It was dark and Merry could see nothing as he lay on the ground rolled 41 | in a blanket; yet though the night was airless and windless, all about him 42 | hidden trees were sighing softly. He lifted his head. Then he heard it 43 | again: a sound like faint drums in the wooded hills and mountain-steps. The 44 | throb would cease suddenly and then be taken up again at some other point, 45 | now nearer, now further off. He wondered if the watchmen had heard it. 46 | He could not see them, but he knew that all round him were the 47 | companies of the Rohirrim. He could smell the horses in the dark, and could 48 | hear their shiftings and their soft stamping on the needle-covered ground. 49 | The host was bivouacked in the pine-woods that clustered about Eilenach 50 | Beacon, a tall hill standing up from the long ridges of the Dr®adan Forest 51 | that lay beside the great road in East Anurien. 52 | Tired as he was Merry could not sleep. He had ridden now for four days 53 | on end, and the ever-deepening gloom had slowly weighed down his heart. He 54 | began to wonder why he had been so eager to come, when he had been given 55 | every excuse, even his lord's command, to stay behind. He wondered, too, if 56 | the old King knew that he had been disobeyed and was angry. Perhaps not. 57 | There seemed to be some understanding between Dernhelm and Elfhelm, 58 | the 59 | Marshal who commanded the jored in which they were riding. He and all his 60 | men ignored Merry and pretended not to hear if he spoke. He might have been 61 | just another bag that Dernhelm was carrying. Dernhelm was no comfort: he 62 | never spoke to anyone. Merry felt small, unwanted, and lonely. Now the time 63 | was anxious, and the host was in peril. They were less than a day's ride 64 | from the out-walls of Minas Tirith that encircled the townlands. Scouts had 65 | been sent ahead. Some had not returned. Others hastening back had reported 66 | that the road was held in force against them. A host of the enemy was 67 | encamped upon it, three miles west of Amon Don, and some strength of men 68 | was 69 | already thrusting along the road and was no more than three leagues away. 70 | Orcs were roving in the hills and woods along the roadside. The king and 71 | Jomer held council in the watches of the night. 72 | Merry wanted somebody to talk to, and he thought of Pippin. But that 73 | -------------------------------------------------------------------------------- /mm/viz/Metromaps_Website_files/drawLines.js: -------------------------------------------------------------------------------- 1 | function drawLines() { 2 | for (var l in lines) { 3 | var currentNodeSet = lines[l].nodeIDs; 4 | 5 | for (var n = 0; n < currentNodeSet.length - 1; n++) { 6 | var startNode = getNodeByID(currentNodeSet[n]); 7 | var endNode = getNodeByID(currentNodeSet[n+1]); 8 | var lineWidth = 30; 9 | 10 | var dups = getDups(startNode.lineIDs, endNode.lineIDs); 11 | 12 | if (dups.length > 1) { 13 | drawRainbowSeg(startNode, endNode, dups, lineWidth); 14 | } 15 | else { 16 | var segment = new Kinetic.Line({ 17 | points: [startNode.x, startNode.y, endNode.x, endNode.y], 18 | stroke: colors[lines[l].id], 19 | strokeWidth: lineWidth 20 | }); 21 | layer.add(segment); 22 | } 23 | } 24 | } 25 | } 26 | 27 | function drawRainbowSeg(leftNode, rightNode, dups, lineWidth) { 28 | // Get info on this segment 29 | // Also, calculate width of each seg in rainbow -- depends on how many need to share 30 | var leftNodePoint = {x: leftNode.x, y: leftNode.y}; 31 | var rightNodePoint = {x: rightNode.x, y: rightNode.y}; 32 | var width = lineWidth / (dups.length); 33 | 34 | var perpSlope = (-1) * ((leftNode.x - rightNode.x)/ 35 | (leftNode.y - rightNode.y)); 36 | var basePointLeft = offsetPoint (leftNodePoint, 15, perpSlope, true); 37 | var basePointRight = offsetPoint (rightNodePoint, 15, perpSlope, true); 38 | 39 | var currentPointLeft = offsetPoint (basePointLeft, width/2, perpSlope, false); 40 | var currentPointRight = offsetPoint (basePointRight, width/2, perpSlope, false); 41 | 42 | for (var s in dups) { 43 | var color = colors[parseInt(dups[s])]; 44 | 45 | var lineSegment = new Kinetic.Line({ 46 | points: [currentPointLeft, currentPointRight], 47 | stroke: color, 48 | strokeWidth: width, 49 | lineCap: 'round', 50 | lineJoin: 'round' 51 | }); 52 | layer.add(lineSegment); 53 | layer.draw(); 54 | 55 | currentPointLeft = offsetPoint (currentPointLeft, width, perpSlope, false); 56 | currentPointRight = offsetPoint (currentPointRight, width, perpSlope, false); 57 | } 58 | } 59 | 60 | // Helper function for drawRainbowLineSegment 61 | // determine which lines are shared by two neighboring nodes 62 | function getDups (array1, array2) { 63 | var dups = []; 64 | for (var a in array1) { 65 | for (var b in array2) { 66 | if (array1[a] == array2[b]) { 67 | dups.push(array1[a]); 68 | } 69 | } 70 | } 71 | return dups; 72 | } 73 | 74 | // Helper function for drawRainbowLineSegment 75 | // Find offset and iteratively draw different lines up 76 | function offsetPoint (originalPoint, distance, slope, down) { 77 | if (slope == undefined){ 78 | console.log("slope is undefined"); 79 | } 80 | else if (slope == Infinity) { 81 | var offset = distance; 82 | if (down) { 83 | offset = offset * -1; 84 | } 85 | return {x: originalPoint.x, y: originalPoint.y + offset}; 86 | } 87 | else { 88 | var xOffset = Math.sqrt((distance * distance)/(slope * slope + 1)); 89 | var yOffset = slope * xOffset; 90 | if (down){ 91 | xOffset = xOffset * -1; 92 | yOffset = yOffset * -1; 93 | } 94 | return {x: originalPoint.x + xOffset, y: originalPoint.y + yOffset}; 95 | } 96 | } 97 | 98 | 99 | 100 | function drawLineLabels() { 101 | for (var l in lines) { 102 | var currentNodeSet = lines[l].nodeIDs; 103 | drawLineLabel(lines[l], 104 | getNodeByID(currentNodeSet[0]), 105 | getNodeByID(currentNodeSet[1])); 106 | } 107 | } 108 | 109 | function drawLineLabel(line, firstNode, secondNode) { 110 | var labelWidth = (secondNode.x - firstNode.x - firstNode.radius - secondNode.radius); 111 | labelWidth = Math.min(labelWidth, 200); 112 | 113 | var lineLabel = new Kinetic.Text({ 114 | x: firstNode.x + firstNode.radius, 115 | y: firstNode.y + 16, 116 | width: labelWidth, 117 | text: line.line_label, 118 | fontSize: 15, 119 | fontFamily: 'Calibri', 120 | align: 'center', 121 | fill: colors[line.id] 122 | }); 123 | 124 | var tab = new Kinetic.Rect({ 125 | x: firstNode.x + firstNode.radius, 126 | y: firstNode.y + 16, 127 | fill: '#f9f9f9', 128 | width: labelWidth, 129 | height: lineLabel.getHeight() + 5, 130 | shadowColor: 'black', 131 | shadowBlur: 10, 132 | shadowOffset: [5, 5], 133 | shadowOpacity: 0.2, 134 | cornerRadius: 5 135 | }); 136 | 137 | var slope = (secondNode.y - firstNode.y)/(secondNode.x - firstNode.x) 138 | var angle = Math.atan(slope) 139 | 140 | tab.rotate(angle); 141 | lineLabel.rotate(angle); 142 | 143 | tab.on('mouseenter', function() { 144 | tab.moveToTop(); 145 | lineLabel.moveToTop(); 146 | layer.draw(); 147 | }); 148 | lineLabel.on('mouseenter', function() { 149 | tab.moveToTop(); 150 | lineLabel.moveToTop(); 151 | layer.draw(); 152 | }); 153 | 154 | layer.add(tab); 155 | layer.add(lineLabel); 156 | layer.add(lineLabel); 157 | } -------------------------------------------------------------------------------- /domains/lotr/data/rawtext/76.txt: -------------------------------------------------------------------------------- 1 | sing us something that we haven't heard before!' 2 | For a moment Frodo stood gaping. Then in desperation he began a 3 | ridiculous song that Bilbo had been rather fond of (and indeed rather proud 4 | of, for he had made up the words himself). It was about an inn; and that is 5 | probably why it came into Frodo's mind just then. Here it is in full. Only a 6 | few words of it are now, as a rule, remembered. 7 | There is an inn, a merry old inn 8 | beneath an old grey hill, 9 | And there they brew a beer so brown 10 | That the Man in the Moon himself came down 11 | one night to drink his fill. 12 | The ostler has a tipsy cat 13 | that plays a five-stringed fiddle; 14 | And up and down he runs his bow, 15 | Now squeaking high, now purring low, 16 | now sawing in the middle. 17 | The landlord keeps a little dog 18 | that is mighty fond of jokes; 19 | When there's good cheer among the guests, 20 | He cocks an ear at all the jests 21 | and laughs until he chokes. 22 | They also keep a horned cow 23 | as proud as any queen; 24 | But music turns her head like ale, 25 | And makes her wave her tufted tail 26 | and dance upon the green. 27 | And O! the rows of silver dishes 28 | and the store of silver spoons! 29 | For Sunday* there's a special pair, 30 | And these they polish up with care 31 | on Saturday afternoons. 32 | The Man in the Moon was drinking deep, 33 | and the cat began to wail; 34 | A dish and a spoon on the table danced, 35 | The cow in the garden madly pranced, 36 | and the little dog chased his tail. 37 | The Man in the Moon took another mug, 38 | and then rolled beneath his chair; 39 | And there he dozed and dreamed of ale, 40 | Till in the sky the stars were pale, 41 | and dawn was in the air. 42 | Then the ostler said to his tipsy cat: 43 | 'The white horses of the Moon, 44 | They neigh and champ their silver bits; 45 | But their master's been and drowned his wits, 46 | and the Sun'll be rising soon!' 47 | So the cat on his fiddle played hey-diddle-diddle, 48 | a jig that would wake the dead: 49 | He squeaked and sawed and quickened the tune, 50 | While the landlord shook the Man in the Moon: 51 | 'It's after three!' he said. 52 | They rolled the Man slowly up the hill 53 | and bundled him into the Moon, 54 | While his horses galloped up in rear, 55 | And the cow came capering like a deer, 56 | and a dish ran up with the spoon. 57 | Now quicker the fiddle went deedle-dum-diddle; 58 | the dog began to roar, 59 | The cow and the horses stood on their heads; 60 | The guests all bounded from their beds 61 | and danced upon the floor. 62 | With a ping and a pong the fiddle-strings broke! 63 | the cow jumped over the Moon, 64 | And the little dog laughed to see such fun, 65 | And the Saturday dish went off at a run 66 | with the silver Sunday spoon. 67 | The round Moon rolled behind the hill 68 | as the Sun raised up her head. 69 | She* hardly believed her fiery eyes; 70 | For though it was day, to her surprise 71 | they all went back to bed! 72 | There was loud and long applause. Frodo had a good voice, and the song 73 | tickled their fancy. 'Where's old Barley?' they cried. 'He ought to hear 74 | this. Bob ought to learn his cat the fiddle, and then we'd have a dance.' 75 | They called for more ale, and began to shout: 'Let's have it again, master! 76 | Come on now! Once more!' 77 | They made Frodo have another drink, and then begin his song again, 78 | while many of them joined in; for the tune was well known, and they were 79 | quick at picking up words. It was now Frodo's turn to feel pleased with 80 | himself. He capered about on the table; and when he came a second time to 81 | the cow jumped over the Moon, he leaped in the air. Much too vigorously; for 82 | he came down, bang, into a tray full of mugs, and slipped, and rolled off 83 | the table with a crash, clatter, and bump! The audience all opened their 84 | mouths wide for laughter, and stopped short a gaping silence; for the singer 85 | disappeared. He simply vanished, as if he had gone slap through the floor 86 | without leaving a hole! 87 | The local hobbits stared in amazement, and then sprang to their feet 88 | and shouted for Barliman. All the company drew away from Pippin and Sam, 89 | who 90 | found themselves left alone in a comer, and eyed darkly and doubtfully from 91 | a distance. It was plain that many people regarded them now as the 92 | companions of a travelling magician of unknown powers and purpose. But 93 | there 94 | was one swarthy Bree-lander, who stood looking at them with a knowing and 95 | half-mocking expression that made them feel very uncomfortable. Presently he 96 | slipped out of the door, followed by the squint-eyed southerner: the two had 97 | been whispering together a good deal during the evening. Harry the 98 | gatekeeper also went out just behind them.. 99 | Frodo felt a fool. Not knowing what else to do, he crawled away under 100 | -------------------------------------------------------------------------------- /domains/lotr/data/rawtext/136.txt: -------------------------------------------------------------------------------- 1 | `No indeed!' said Elrond, turning towards him with a smile. `You at 2 | least shall go with him. It is hardly possible to separate you from him, 3 | even when he is summoned to a secret council and you are not.' 4 | Sam sat down, blushing and muttering. `A nice pickle we have landed 5 | ourselves in, Mr. Frodo!' he said, shaking his head. 6 | Chapter 3. The Ring Goes South 7 | Later that day the hobbits held a meeting of their own in Bilbo's room. 8 | Merry and Pippin were indignant when they heard that Sam had crept into the 9 | Council, and had been chosen as Frodo's companion. 10 | `It's most unfair,' said Pippin. `Instead of throwing him out, and 11 | clapping him in chains, Elrond goes and rewards him for his cheek!' 12 | `Rewards!' said Frodo. 'I can't imagine a more severe punishment. You 13 | are not thinking what you are saying: condemned to go on this hopeless 14 | journey, a reward? Yesterday I dreamed that my task was done, and I could 15 | rest here, a long while, perhaps for good.' 16 | 'I don't wonder,' said Merry, 'and I wish you could. But we are envying 17 | Sam, not you. If you have to go, then it will be a punishment for any of us 18 | to be left behind, even in Rivendell. We have come a long way with you and 19 | been through some stiff times. We want to go on.' 20 | `That's what I meant,' said Pippin. `We hobbits ought to stick 21 | together, and we will. I shall go, unless they chain me up. There must be 22 | someone with intelligence in the party.' 23 | 'Then you certainly will not be chosen, Peregrin Took!' said Gandalf, 24 | looking in through the window, which was near the ground. `But you are all 25 | worrying yourselves unnecessarily. Nothing is decided yet.' 26 | `Nothing decided!' cried Pippin. 'Then what were you all doing? You 27 | were shut up for hours.' 28 | "Talking,' said Bilbo. `There was a deal of talk, and everyone had an 29 | eye-opener. Even old Gandalf. I think Legolas's bit of news about Gollum 30 | caught even him on the hop, though he passed it off.' 31 | `You were wrong,' said Gandalf. 'You were inattentive. I had already 32 | heard of it from Gwaihir. If you want to know, the only real eye-openers, as 33 | you put it, were you and Frodo; and I was the only one that was not 34 | surprised.' 35 | `Well, anyway,' said Bilbo, 'nothing was decided beyond choosing poor 36 | Frodo and Sam. I was afraid all the time that it might come to that, if I 37 | was let off. But if you ask me, Elrond will send out a fair number, when the 38 | reports come in. Have they started yet, Gandalf?' 39 | 'Yes,' said the wizard. `Some of the scouts have been sent out already. 40 | More will go tomorrow. Elrond is sending Elves, and they will get in touch 41 | with the Rangers, and maybe with Thranduil's folk in Mirkwood. And 42 | Aragorn 43 | has gone with Elrond's sons. We shall have to scour the lands all round for 44 | many long leagues before any move is made. So cheer up, Frodo! You will 45 | probably make quite a long stay here.' 46 | 'Ah!' said Sam gloomily. 'We'll just wait long enough for winter to 47 | come.' 48 | 'That can't be helped,' said Bilbo. 'It's your fault partly, Frodo my 49 | lad: insisting on waiting for my birthday. A funny way of honouring it, I 50 | can't help thinking. Not the day I should have chosen for letting the S.-B.s 51 | into Bag End. But there it is: you can't wait now fill spring; and you can't 52 | go till the reports come back. 53 | When winter first begins to bite 54 | and stones crack in the frosty night, 55 | when pools are black and trees are bare, 56 | 'tis evil in the Wild to fare. 57 | But that I am afraid will be just your luck.' 58 | 'I am afraid it will,' said Gandalf. 'We can't start until we have 59 | found out about the Riders.' 60 | `I thought they were all destroyed in the flood,' said Merry. 61 | 'You cannot destroy Ringwraiths like that,' said Gandalf. `The power of 62 | their master is in them, and they stand or fall by him. We hope that they 63 | were all unhorsed and unmasked, and so made for a while less dangerous; but 64 | we must find out for certain. In the meantime you should try and forget your 65 | troubles, Frodo. I do not know if I can do anything to help you; but I will 66 | whisper this in your ears. Someone said that intelligence would be needed in 67 | the party. He was right. I think I shall come with you.' 68 | So great was Frodo's delight at this announcement that Gandalf left the 69 | window-sill, where he had been sitting, and took off his hat and bowed. 'I 70 | only said I think I shall come . Do not count on anything yet. In this matter 71 | Elrond will have much to say, and your friend the Strider. Which reminds me, 72 | I want to see Elrond. I must be off.' 73 | `How long do you think I shall have here?' said Frodo to Bilbo when 74 | Gandalf had gone. 75 | `Oh, I don't know. I can't count days in Rivendell,' said Bilbo. 'But 76 | quite long, I should think. We can have many a good talk. What about helping 77 | -------------------------------------------------------------------------------- /domains/lotr/data/rawtext/36.txt: -------------------------------------------------------------------------------- 1 | through the lands. The Wandering Companies shall know of your journey, 2 | and 3 | those that have power for good shall be on the watch. I name you Elf-friend; 4 | and may the stars shine upon the end of your road! Seldom have we had such 5 | delight in strangers, and it is fair to hear words of the Ancient Speech 6 | from the lips of other wanderers in the world.' 7 | Frodo felt sleep coming upon him, even as Gildor finished speaking. 'I 8 | will sleep now,' he said; and the Elf led him to a bower beside Pippin, and 9 | he threw himself upon a bed and fell at once into a dreamless slumber. 10 | Chapter 4. A Short Cut to Mushrooms 11 | In the morning Frodo woke refreshed. He was lying in a bower made by a 12 | living tree with branches laced and drooping to the ground; his bed was of 13 | fern and grass, deep and soft and strangely fragrant. The sun was shining 14 | through the fluttering leaves, which were still green upon the tree. He 15 | jumped up and went out. 16 | Sam was sitting on the grass near the edge of the wood. Pippin was 17 | standing studying the sky and weather. There was no sign of the Elves. 18 | 'They have left us fruit and drink, and bread,' said Pippin. 'Come and 19 | have your breakfast. The bread tastes almost as good as it did last night. I 20 | did not want to leave you any, but Sam insisted.' 21 | Frodo sat down beside Sam and began to eat. 'What is the plan for 22 | today?' asked Pippin. 23 | 'To walk to Bucklebury as quickly as possible,' answered Frodo, and 24 | gave his attention to the food. 25 | 'Do you think we shall see anything of those Riders?' asked Pippin 26 | cheerfully. Under the morning sun the prospect of seeing a whole troop of 27 | them did not seem very alarming to him. 28 | 'Yes, probably,' said Frodo, not liking the reminder. 'But I hope to 29 | get across the river without their seeing us.' 30 | 'Did you find out anything about them from Gildor?' 31 | 'Not much - only hints and riddles,' said Frodo evasively. 'Did you ask 32 | about the sniffing?' 33 | 'We didn't discuss it,' said Frodo with his mouth full. 34 | 'You should have. I am sure it is very important.' 35 | 'In that case I am sure Gildor would have refused to explain it,' said 36 | Frodo sharply. 'And now leave me in peace for a bit! I don't want to answer 37 | a string of questions while I am eating. I want to think!' 38 | 'Good heavens!' said Pippin. 'At breakfast?' He walked away towards the 39 | edge of the green. 40 | From Frodo's mind the bright morning - treacherously bright, he thought 41 | - had not banished the fear of pursuit; and he pondered the words of Gildor. 42 | The merry voice of Pippin came to him. He was running on the green turf and 43 | singing. 44 | 'No! I could not!' he said to himself. 'It is one thing to take my 45 | young friends walking over the Shire with me, until we are hungry and weary, 46 | and food and bed are sweet. To take them into exile, where hunger and 47 | weariness may have no cure, is quite another - even if they are willing to 48 | come. The inheritance is mine alone. I don't think I ought even to take 49 | Sam.' He looked at Sam Gamgee, and discovered that Sam was watching him. 50 | 'Well, Sam!' he said. 'What about it? I am leaving the Shire as soon as 51 | ever I can - in fact I have made up my mind now not even to wait a day at 52 | Crickhollow, if it can be helped.' 53 | 'Very good, sir!' 54 | 'You still mean to come with me?' 55 | 'I do.' 56 | 'It is going to be very dangerous, Sam. 'It is already dangerous. Most 57 | likely neither of us will come back.' 58 | 'If you don't come back, sir, then I shan't, that's certain,' said Sam. 59 | 'Don't you leave him! they said to me. Leave him! I said. I never mean to. I 60 | am going with him, if he climbs to the Moon, and if any of those Black 61 | Rulers try to stop him, they'll have Sam Gamgee to reckon with, I said. They 62 | laughed.' 63 | 'Who are they, and what are you talking about?' 64 | 'The Elves, sir. We had some talk last night; and they seemed to know 65 | you were going away, so I didn't see the use of denying it. Wonderful folk, 66 | Elves, sir! Wonderful!' 67 | 'They are,' said Frodo. 'Do you like them still, now you have had a 68 | closer view?' 69 | 'They seem a bit above my likes and dislikes, so to speak,' answered 70 | Sam slowly. 'It don't seem to matter what I think about them. They are quite 71 | different from what I expected - so old and young, and so gay and sad, as it 72 | were.' 73 | Frodo looked at Sam rather startled, half expecting to see some outward 74 | sign of the odd change that seemed to have come over him. It did not sound 75 | like the voice of the old Sam Gamgee that he thought he knew. But it looked 76 | like the old Sam Gamgee sitting there, except that his face was unusually 77 | thoughtful. 78 | 'Do you feel any need to leave the Shire now - now that your wish to 79 | see them has come true already?' he asked. 80 | 'Yes, sir. I don't know how to say it, but after last night I feel 81 | -------------------------------------------------------------------------------- /domains/lotr/data/rawtext/312.txt: -------------------------------------------------------------------------------- 1 | As he fell slowly into sleep, Pippin had a strange feeling: he and 2 | Gandalf were still as stone, seated upon the statue of a running horse, 3 | while the world rolled away beneath his feet with a great noise of wind. 4 | * BOOK IV * 5 | Chapter 1. The Taming of Smjagol 6 | 'Well, master, we're in a fix and no mistake,' said Sam Gamgee. He 7 | stood despondently with hunched shoulders beside Frodo, and peered out with 8 | puckered eyes into the gloom. 9 | It was the third evening since they had fled from the Company, as far 10 | as they could tell: they had almost lost count of the hours during which 11 | they had climbed and laboured among the barren slopes and stones of the 12 | Emyn 13 | Muil, sometimes retracing their steps because they could find no way 14 | forward, sometimes discovering that they had wandered in a circle back to 15 | where they had been hours before. Yet on the whole they had worked steadily 16 | eastward, keeping as near as they could find a way to the outer edge of this 17 | strange twisted knot of hills. But always they found its outward faces 18 | sheer, high and impassable, frowning over the plain below; beyond its 19 | tumbled skirts lay livid festering marshes where nothing moved and not even 20 | a bird was to be seen. 21 | The hobbits stood now on the brink of a tall cliff, bare and bleak, its 22 | feet wrapped in mist; and behind them rose the broken highlands crowned with 23 | drifting cloud. A chill wind` blew from the East. Night was gathering over 24 | the shapeless lands before them; the sickly green of them was fading to a 25 | sullen brown. Far away to the right the Anduin, that had gleamed fitfully in 26 | sun-breaks during the day, was now hidden in shadow. But their eyes did not 27 | look beyond the River, back to Gondor, to their friends, to the lands of 28 | Men. South and east they stared to where, at the edge of the oncoming night, 29 | a dark line hung, like distant mountains of motionless smoke. Every now and 30 | again a tiny red gleam far away flickered upwards on the rim of earth and 31 | sky. 32 | `What a fix! ' said Sam. `That's the one place in all the lands we've 33 | ever heard of that we don't want to see any closer; and that's the one place 34 | we're trying to get to! And that's just where we can't get, nohow. We've 35 | come the wrong way altogether, seemingly. We can't get down; and if we did 36 | get down, we'd find all that green land a nasty bog, I'll warrant. Phew! Can 37 | you smell it?' He sniffed at the wind. 38 | 'Yes, I can smell it,' said Frodo, but he did not move, and his eyes 39 | remained fixed, staring out towards the dark line and the flickering flame. 40 | `Mordor! ' he muttered under his breath. 'If I must go there I wish I could 41 | come there quickly and make an end! ' He shuddered. The wind was chilly and 42 | yet heavy with an odour of cold decay. `Well,' he said, at last withdrawing 43 | his eyes, `we cannot stay here all night, fix or no fix. We must find a more 44 | sheltered spot, and camp once more; and perhaps another day will show us a 45 | path.' 46 | 'Or another and another and another,' muttered Sam. `Or maybe no day. 47 | We've come the wrong way.' 48 | 'I wonder,' said Frodo. 'It's my doom, I think, to go to that Shadow 49 | yonder, so that a way will be found. But will good or evil show it to me? 50 | What hope we had was in speed. Delay plays into the Enemy's hands-and here I 51 | am: delayed. Is it the will of the Dark Tower that steers us? All my choices 52 | have proved ill. I should have left the Company long before, and come down 53 | from the North, east of the River and of the Emyn Muil, and so over the hard 54 | of Battle Plain to the passes of Mordor. But now it isn't possible for you 55 | and me alone to find a way back, and the Orcs are prowling on the east bank. 56 | Every day that passes is a precious day lost. I am tired, Sam. I don't know 57 | what is to be done. What food have we got left?' 58 | 'Only those, what d'you call 'em, lembas , Mr. Frodo. A fair supply. But 59 | they are better than naught, by a long bite. I never thought, though, when I 60 | first set tooth in them, that I should ever come to wish for a change. But I 61 | do now: a bit of plain bread, and a mug -- aye, half a mug -- of beer would 62 | go down proper. I've lugged my cooking-gear all the way from the last camp, 63 | and what use has it been? Naught to make a fire with, for a start; and 64 | naught to cook, not even grass!' 65 | They turned away and went down into a stony hollow. The westering sun 66 | was caught into clouds, and night came swiftly. They slept as well as they 67 | could for the cold, turn and turn about, in a nook among great jagged 68 | pinnacles of weathered rock; at least they were sheltered from the easterly 69 | wind. 70 | `Did you see them again, Mr. Frodo?' asked Sam, as they sat, stiff and 71 | chilled, munching wafers of lembas , in the cold grey of early morning. 72 | 'No,' said Frodo. `I've heard nothing, and seen nothing, for two nights 73 | -------------------------------------------------------------------------------- /domains/lotr/data/rawtext/469.txt: -------------------------------------------------------------------------------- 1 | assault. 'Well, well, now at any rate I understand poor Denethor a little 2 | better. We might die together, Merry and I, and since die we must, why not? 3 | Well, as he is not here, I hope he'll find an easier end. But now I must do 4 | my best.' 5 | He drew his sword and looked at it, and the intertwining shapes of red 6 | and gold; and the flowing characters of N®menor glinted like fire upon the 7 | blade. 'This was made for just such an hour,' he thought. 'If only I could 8 | smite that foul Messenger with it, then almost I should draw level with old 9 | Merry. Well, I'll smite some of this beastly brood before the end. I wish I 10 | could see cool sunlight and green grass again!' 11 | Then even as he thought these things the first assault crashed into 12 | them. The orcs hindered by the mires that lay before the hills halted and 13 | poured their arrows into the defending ranks. But through them there came 14 | striding up, roaring like beasts, a great company of hill-trolls out of 15 | Gorgoroth. Taller and broader than Men they were, and they were clad only in 16 | close-fitting mesh of horny scales, or maybe that was their hideous hide; 17 | but they bore round bucklers huge and black and wielded heavy hammers in 18 | their knotted hands. Reckless they sprang into the pools and waded across, 19 | bellowing as they came. Like a storm they broke upon the line of the men of 20 | Gondor, and beat upon helm and head, and arm and shield as smiths hewing the 21 | hot bending iron. At Pippin's side Beregond was stunned and overborne, and 22 | he fell; and the great troll-chief that smote him down bent over him, 23 | reaching out a clutching claw; for these fell creatures would bite the 24 | throats of those that they threw down. 25 | Then Pippin stabbed upwards, and the written blade of Westernesse 26 | pierced through the hide and went deep into the vitals of the troll, and his 27 | black blood came gushing out. He toppled forward and came crashing down 28 | like 29 | a falling rock, burying those beneath him. Blackness and stench and crushing 30 | pain came upon Pippin, and his mind fell away into a great darkness. 31 | 'So it ends as I guessed it would,' his thought said, even as it 32 | fluttered away; and it laughed a little within him ere it fled, almost gay 33 | it seemed to be casting off at last all doubt and care and fear. And then 34 | even as it winged away into forgetfulness it heard voices, and they seemed 35 | to be crying in some forgotten world far above: 36 | 'The Eagles are coming! The Eagles are coming!' 37 | For one moment more Pippin's thought hovered. 'Bilbo!' it said. 'But 38 | no! That came in his tale, long long ago. This is my tale, and it is ended 39 | now. Good-bye!' And his thought fled far away and his eyes saw no more. 40 | * BOOK VI * 41 | Chapter 1. The Tower of Cirith Ungol 42 | Sam roused himself painfully from the ground. For a moment he wondered 43 | where he was, and then all the misery and despair returned to him. He was in 44 | the deep dark outside the under-gate of the orcs' stronghold; its brazen 45 | doors were shut. He must have fallen stunned when he hurled himself against 46 | them; but how long he had lain there he did not know. Then he had been on 47 | fire, desperate and furious; now he was shivering and cold. He crept to the 48 | doors and pressed his ears against them. 49 | Far within he could hear faintly the voices of ores clamouring, but 50 | soon they stopped or passed out of hearing, and all was still. His head 51 | ached and his eyes saw phantom lights in the darkness, but he struggled to 52 | steady himself and think. It was clear at any rate that he had no hope of 53 | getting into the orc-hold by that gate; he might wait there for days before 54 | it was opened, and he could not wait: time was desperately precious. He no 55 | longer had any doubt about his duty: he must rescue his master or perish in 56 | the attempt. 57 | 'The perishing is more likely, and will be a lot easier anyway,' he 58 | said grimly to himself, as he sheathed Sting and turned from the brazen 59 | doors. Slowly he groped his way back in the dark along the tunnel, not 60 | daring to use the elven-light; and as he went he tried to fit together the 61 | events since Frodo and he had left the Cross-roads. He wondered what the 62 | time was. Somewhere between one day and the next, he supposed; but even of 63 | the days he had quite lost count. He was in a land of darkness where the 64 | days of the world seemed forgotten, and where all who entered were forgotten 65 | too. 66 | 'I wonder if they think of us at all,' he said, 'and what is happening 67 | to them all away there.' He waved his hand vaguely in the air before him; 68 | but he was in fact now facing southwards, as he came back to Shelob's 69 | tunnel, not west. Out westward in the world it was drawing to noon upon the 70 | fourteenth day of March in the Shire-reckoning. And even now Aragorn was 71 | leading the black fleet from Pelargir, and Merry was riding with the 72 | -------------------------------------------------------------------------------- /domains/lotr/data/rawtext/450.txt: -------------------------------------------------------------------------------- 1 | shall return soon.' 2 | With that he turned away and went with Pippin down towards the lower 3 | city. And even as they hastened on their way the wind brought a grey rain, 4 | and all the fires sank, and there arose a great smoke before them. 5 | Chapter 8. The Houses of Healing 6 | A mist was in Merry's eyes of tears and weariness when they drew near 7 | the ruined Gate of Minas Tirith. He gave little heed to the wreck and 8 | slaughter that lay about all. Fire and smoke and stench was in the air; for 9 | many engines had been burned or cast into the fire-pits, and many of the 10 | slain also, while here and there lay many carcases of the great Southron 11 | monsters, half-burned, or broken by stone-cast, or shot through the eyes by 12 | the valiant archers of Morthond. The flying rain had ceased for a time, and 13 | the sun gleamed up above; but all the lower city was still wrapped in a 14 | smouldering reek. 15 | Already men were labouring to clear a way through the jetsam of battle; 16 | and now out from the Gate came some bearing litters. Gently they laid Jowyn 17 | upon soft pillows; but the king's body they covered with a great cloth of 18 | gold, and they bore torches about him, and their flames, pale in the 19 | sunlight, were fluttered by the wind. 20 | So Thjoden and Jowyn came to the City of Gondor, and all who saw them 21 | bared their heads and bowed; and they passed through the ash and fume of the 22 | burned circle, and went on and up along the streets of stone. To Merry the 23 | ascent seemed agelong, a meaningless journey in a hateful dream, going on 24 | and on to some dim ending that memory cannot seize. 25 | Slowly the lights of the torches in front of him flickered and went 26 | out, and he was walking in a darkness; and he thought: 'This is a tunnel 27 | leading to a tomb; there we shall stay forever.' But suddenly into his dream 28 | there fell a living voice. 29 | 'Well, Merry! Thank goodness I have found you!' 30 | He looked up and the mist before his eyes cleared a little. There was 31 | Pippin! They were face to face in a narrow lane, and but for themselves it 32 | was empty. He rubbed his eyes. 33 | 'Where is the king?' he said. 'And Jowyn?' Then he stumbled and sat 34 | down on a doorstep and began to weep again. 35 | 'They have gone up into the Citadel,' said Pippin. 'I think you must 36 | have fallen asleep on your feet and taken the wrong turning. When we found 37 | that you were not with them, Gandalf sent me to look for you. Poor old 38 | Merry! How glad I am to see you again! But you are worn out, and I won't 39 | bother you with any talk. But tell me, are you hurt, or wounded?' 40 | 'No,' said Merry. 'Well, no, I don't think so. But I can't use my right 41 | arm, Pippin, not since I stabbed him. And my sword burned all away like a 42 | piece of wood.' 43 | Pippin's face was anxious. 'Well, you had better come with me as quick 44 | as you can,' he said. 'I wish I could carry you. You aren't fit to walk any 45 | further. They shouldn't have let you walk at all; but you must forgive them. 46 | So many dreadful things have happened in the City, Merry, that one poor 47 | hobbit coming in from the battle is easily overlooked.' 48 | 'It's not always a misfortune being overlooked,' said Merry. 'I was 49 | overlooked just now by - no, no, I can't speak of it. Help me, Pippin! It's 50 | all going dark again, and my arm is so cold.' 51 | 'Lean on me, Merry lad!' said Pippin. 'Come now! Foot by foot. It's not 52 | far.' 53 | 'Are you going to bury me?' said Merry. 54 | 'No, indeed!' said Pippin, trying to sound cheerful, though his heart 55 | was wrung with fear and pity. 'No, we are going to the Houses of Healing.' 56 | They turned out of the lane that ran between tall houses and the outer 57 | wall of the fourth circle, and they regained the main street climbing up to 58 | the Citadel. Step by step they went, while Merry swayed and murmured as one 59 | in sleep. 60 | 'I'll never get him there,' thought Pippin. 'Is there no one to help 61 | me? I can't leave him here.' Just then to his surprise a boy came running up 62 | behind, and as he passed he recognized Bergil Beregond's son. 63 | 'Hullo, Bergil!' he called. 'Where are you going? Glad to see you 64 | again, and still alive!' 65 | 'I am running errands for the Healers,' said Bergil. 'I cannot stay.' 66 | 'Don't!' said Pippin. 'But tell them up there that I have a sick 67 | hobbit, a perian mind you, come from the battle-field. I don't think he can 68 | walk so far. If Mithrandir is there, he will be glad of the message.' Bergil 69 | ran on. 70 | 'I'd better wait here,' thought Pippin. So he let Merry sink gently 71 | down on to the pavement in a patch of sunlight, and then he sat down beside 72 | him, laying Merry's head in his lap. He felt his body and limbs gently, and 73 | took his friend's hands in his own. The right hand felt icy to the touch. 74 | It was not long before Gandalf himself came in search of them. He 75 | stooped over Merry and caressed his brow; then he lifted him carefully. 'He 76 | -------------------------------------------------------------------------------- /domains/lotr/data/rawtext/116.txt: -------------------------------------------------------------------------------- 1 | the yellow gold and jewels wan. 2 | He saw the Mountain silent rise 3 | where twilight lies upon the knees 4 | of Valinor, and Eldamar 5 | beheld afar beyond the seas. 6 | A wanderer escaped from night 7 | to haven white he came at last, 8 | to Elvenhome the green and fair 9 | where keen the air, where pale as glass 10 | beneath the Hill of Ilmarin 11 | a-glimmer in a valley sheer 12 | the lamplit towers of Tirion 13 | are mirrored on the Shadowmere. 14 | He tarried there from errantry, 15 | and melodies they taught to him, 16 | and sages old him marvels told, 17 | and harps of gold they brought to him. 18 | They clothed him then in elven-white, 19 | and seven lights before him sent, 20 | as through the Calacirian 21 | to hidden land forlorn he went. 22 | He came unto the timeless halls 23 | where shining fall the countless years, 24 | and endless reigns the Elder King 25 | in Ilmarin on Mountain sheer; 26 | and words unheard were spoken then 27 | of folk of Men and Elven-kin, 28 | beyond the world were visions showed 29 | forbid to those that dwell therein. 30 | A ship then new they built for him 31 | of mithril and of elven-glass 32 | with shining prow; no shaven oar 33 | nor sail she bore on silver mast: 34 | the Silmaril as lantern light 35 | and banner bright with living flame 36 | to gleam thereon by Elbereth 37 | herself was set, who thither came 38 | and wings immortal made for him, 39 | and laid on him undying doom, 40 | to sail the shoreless skies and come 41 | behind the Sun and light of Moon. 42 | From Evereven's lofty hills 43 | where softly silver fountains fall 44 | his wings him bore, a wandering light, 45 | beyond the mighty Mountain Wall. 46 | From World's End then he turned away 47 | and yearned again to find afar 48 | his home through shadows journeying, 49 | and burning as an island star 50 | on high above the mists he came, 51 | a distant flame before the Sun, 52 | a wonder ere the waking dawn 53 | where grey the Norland waters run. 54 | And over Middle-earth he passed 55 | and heard at last the weeping sore 56 | of women and of elven-maids 57 | in Elder Days, in years of yore. 58 | gut on him mighty doom was laid, 59 | till Moon should fade, an orb‚d star 60 | to pass, and tarry never more 61 | on Hither Shores where mortals are; 62 | for ever still a herald on 63 | an errand that should never rest 64 | to bear his shining lamp afar, 65 | the Flammifer of Westernesse. 66 | The chanting ceased. Frodo opened his eyes and saw that Bilbo was 67 | seated on his stool in a circle of listeners, who were smiling and 68 | applauding. 69 | `Now we had better have it again,' said an Elf. 70 | Bilbo got up and bowed. `I am flattered, Lindir,' he said. 'But it 71 | would be too tiring to repeat it all.' 72 | 'Not too tiring for you,' the Elves answered laughing. 'You know you 73 | are never tired of reciting your own verses. But really we cannot answer 74 | your question at one hearing!' 75 | `What!' cried Bilbo. 'You can't tell which parts were mine, and which 76 | were the D®nadan's?' 77 | 'It is not easy for us to tell the difference between two mortals' said 78 | the Elf. 79 | 'Nonsense, Lindir,' snorted Bilbo. 'If you can't distinguish between a 80 | Man and a Hobbit, your judgement is poorer than I imagined. They're as 81 | different as peas and apples.' 82 | 'Maybe. To sheep other sheep no doubt appear different,' laughed 83 | Lindir. `Or to shepherds. But Mortals have not been our study. We have other 84 | business.' 85 | 'I won't argue with you,' said Bilbo. 'I am sleepy after so much music 86 | and singing. I'll leave you to guess, if you want to.' 87 | He got up and came towards Frodo. 'Well, that's over,' he said in a low 88 | voice. `It went off better than I expected. I don't often get asked for a 89 | second hearing. What did you think of it?' 90 | `I am not going to try and guess,' said Frodo smiling. 91 | `You needn't,' said Bilbo. `As a matter of fact it was all mine. Except 92 | that Aragorn insisted on my putting in a green stone. He seemed to think it 93 | important. I don't know why. Otherwise he obviously thought the whole thing 94 | rather above my head, and he said that if I had the cheek to make verses 95 | about Edrendil in the house of Elrond, it was my affair. I suppose he was 96 | right.' 97 | 'I don't know,' said Frodo. `It seemed to me to fit somehow, though I 98 | can't explain. I was half asleep when you began, and it seemed to follow on 99 | from something that I was dreaming about. I didn't understand that it was 100 | really you speaking until near the end.' 101 | is 102 | `It difficult to keep awake here, until you get used to it;' said 103 | Bilbo. 'Not that hobbits would ever acquire quite the elvish appetite for 104 | music and poetry and tales. They seem to like them as much as food, or more. 105 | They will be going on for a long time yet. What do you say to slipping off 106 | for some more quiet talk?' 107 | `Can we?' said Frodo. 108 | `Of course. This is merrymaking not business. Come and go as you like, 109 | -------------------------------------------------------------------------------- /domains/lotr/data/rawtext/117.txt: -------------------------------------------------------------------------------- 1 | would be too tiring to repeat it all.' 2 | 'Not too tiring for you,' the Elves answered laughing. 'You know you 3 | are never tired of reciting your own verses. But really we cannot answer 4 | your question at one hearing!' 5 | `What!' cried Bilbo. 'You can't tell which parts were mine, and which 6 | were the D®nadan's?' 7 | 'It is not easy for us to tell the difference between two mortals' said 8 | the Elf. 9 | 'Nonsense, Lindir,' snorted Bilbo. 'If you can't distinguish between a 10 | Man and a Hobbit, your judgement is poorer than I imagined. They're as 11 | different as peas and apples.' 12 | 'Maybe. To sheep other sheep no doubt appear different,' laughed 13 | Lindir. `Or to shepherds. But Mortals have not been our study. We have other 14 | business.' 15 | 'I won't argue with you,' said Bilbo. 'I am sleepy after so much music 16 | and singing. I'll leave you to guess, if you want to.' 17 | He got up and came towards Frodo. 'Well, that's over,' he said in a low 18 | voice. `It went off better than I expected. I don't often get asked for a 19 | second hearing. What did you think of it?' 20 | `I am not going to try and guess,' said Frodo smiling. 21 | `You needn't,' said Bilbo. `As a matter of fact it was all mine. Except 22 | that Aragorn insisted on my putting in a green stone. He seemed to think it 23 | important. I don't know why. Otherwise he obviously thought the whole thing 24 | rather above my head, and he said that if I had the cheek to make verses 25 | about Edrendil in the house of Elrond, it was my affair. I suppose he was 26 | right.' 27 | 'I don't know,' said Frodo. `It seemed to me to fit somehow, though I 28 | can't explain. I was half asleep when you began, and it seemed to follow on 29 | from something that I was dreaming about. I didn't understand that it was 30 | really you speaking until near the end.' 31 | is 32 | `It difficult to keep awake here, until you get used to it;' said 33 | Bilbo. 'Not that hobbits would ever acquire quite the elvish appetite for 34 | music and poetry and tales. They seem to like them as much as food, or more. 35 | They will be going on for a long time yet. What do you say to slipping off 36 | for some more quiet talk?' 37 | `Can we?' said Frodo. 38 | `Of course. This is merrymaking not business. Come and go as you like, 39 | as long as you don't make a noise.' 40 | They got up and withdrew quietly into the shadows, and made for the 41 | doors. Sam they left behind, fast asleep still with a smile on his face. In 42 | spite of his delight in Bilbo's company Frodo felt a tug of regret as they 43 | passed out of the Hall of Fire. Even as they stepped over the threshold a 44 | single clear voice rose in song. 45 | A Elbereth Gilthoniel, 46 | silivren penna mnriel 47 | o menel aglar elenath! 48 | Na-chaered palan-dnriel 49 | o galadhremmin ennorath, 50 | Fanuilos, le linnathon 51 | nef aear, sn nef aearon! 52 | Frodo halted for a moment, looking back. Elrond was in his chair and 53 | the fire was on his face like summer-light upon the trees. Near him sat the 54 | Lady Arwen. To his surprise Frodo saw that Aragorn stood beside her; his 55 | dark cloak was thrown back, and he seemed to be clad in elven-mail, and a 56 | star shone on his breast. They spoke together, and then suddenly it seemed 57 | to Frodo that Arwen turned towards him, and the light of her eyes fell on 58 | him from afar and pierced his heart. 59 | He stood still enchanted, while the sweet syllables of the elvish song 60 | fell like clear jewels of blended word and melody. `It is a song to 61 | Elbereth,' said Bilbo. `They will sing that, and other songs of the Blessed 62 | Realm, many times tonight. Come on!' 63 | He led Frodo back to his own little room. It opened on to the gar dens 64 | and looked south across the ravine of the Bruinen. There they sat for some 65 | while, looking through the window at the bright stars above the 66 | steep-climbing woods, and talking softly. They spoke no more of the small 67 | news of the Shire far away, nor of the dark shadows and perils that 68 | encompassed them, but of the fair things they had seen in the world 69 | together, of the Elves, of the stars, of trees, and the gentle fall of the 70 | bright year in the woods. 71 | At last there came a knock on the door. `Begging your pardon,' said 72 | Sam, putting in his head, `but I was just wondering if you would be wanting 73 | anything.' 74 | `And begging yours, Sam Gamgee,' replied Bilbo. `I guess you mean that 75 | it is time your master went to bed.' 76 | `Well, sir, there is a Council early tomorrow, I hear and he only got 77 | up today for the first time.' 78 | `Quite right, Sam,' laughed Bilbo. `You can trot off and tell Gandalf 79 | that he has gone to bed. Good night, Frodo! Bless me, but it has been good 80 | to see you again! There are no folk like hobbits after all for a real good 81 | talk. I am getting very old, and I began to wonder if I should ever live to 82 | see your chapters of our story. Good night! I'll take a walk, I think, and 83 | look at the stars of Elbereth in the garden. Sleep well!' 84 | -------------------------------------------------------------------------------- /domains/lotr/data/rawtext/187.txt: -------------------------------------------------------------------------------- 1 | grasp. The evil that was devised long ago works on in many ways, whether 2 | Sauron himself stands or falls. Would not that have been a noble deed to set 3 | to the credit of his Ring, if I had taken it by force or fear from my guest? 4 | `And now at last it comes. You will give me the Ring freely! In place 5 | of the Dark Lord you will set up a Queen. And I shall not be dark, but 6 | beautiful and terrible as the Morning and the Night! Fair as the Sea and the 7 | Sun and the Snow upon the Mountain! Dreadful as the Storm and the 8 | Lightning! 9 | Stronger than the foundations of the earth. All shall love me and despair! ' 10 | She lifted up her hand and from the ring that she wore there issued a 11 | great light that illuminated her alone and left all else dark. She stood 12 | before Frodo seeming now tall beyond measurement, and beautiful beyond 13 | enduring, terrible and worshipful. Then she let her hand fall, and the light 14 | faded, and suddenly she laughed again, and lo! she was shrunken: a slender 15 | elf-woman, clad in simple white, whose gentle voice was soft and sad. 16 | 'I pass the test,' she said. `I will diminish, and go into the West and 17 | remain Galadriel.' 18 | They stood for a long while in silence. At length the Lady spoke again. 19 | `Let us return! ' she said. `In the morning you must depart for now we have 20 | chosen, and the tides of fate are flowing.' 21 | `I would ask one thing before we go,' said Frodo, `a thing which I 22 | often meant to ask Gandalf in Rivendell. I am permitted to wear the One 23 | Ring: why cannot I see all the others and know the thoughts of those that 24 | wear them? ' 25 | `You have not tried,' she said. `Only thrice have you set the Ring upon 26 | your finger since you knew what you possessed. Do not try! It would destroy 27 | you. Did not Gandalf tell you that the rings give power according to the 28 | measure of each possessor? Before you could use that power you would need 29 | to 30 | become far stronger, and to train your will to the domination of others. Yet 31 | even so, as Ring-bearer and as one that has borne it on finger and seen that 32 | which is hidden, your sight is grown keener. You have perceived my thought 33 | more clearly than many that are accounted wise. You saw the Eye of him that 34 | holds the Seven and the Nine. And did you not see and recognize the ring 35 | upon my finger? Did you see my ring? ' she asked turning again to Sam. 36 | 'No, Lady,' he answered. `To tell you the truth, I wondered what you 37 | were talking about. I saw a star through your finger. But if you'll pardon 38 | my speaking out, I think my master was right. I wish you'd take his Ring. 39 | You'd put things to rights. You'd stop them digging up the gaffer and 40 | turning him adrift. You'd make some folk pay for their dirty work.' 41 | `I would,' she said. `That is how it would begin. But it would not stop 42 | with that, alas! We will not speak more of it. Let us go!' 43 | Chapter 8. Farewell to Lurien 44 | That night the Company was again summoned to the chamber of Celeborn, 45 | and there the Lord and Lady greeted them with fair words. At length Celeborn 46 | spoke of their departure. 47 | `Now is the time,' he said, `when those who wish to continue the Quest 48 | must harden their hearts to leave this land. Those who no longer wish to go 49 | forward may remain here, for a while. But whether they stay or go, none can 50 | be sure of peace. For we are come now to the edge of doom. Here those who 51 | wish may await the oncoming of the hour till either the ways of the world 52 | lie open again. or we summon them to the last need of Lurien. Then they may 53 | return to their own lands, or else go to the long home of those that fall in 54 | battle.' 55 | There was a silence. `They all resolved to go forward,' said Galadriel 56 | looking in their eyes. 57 | `As for me,' said Boromir, `my way home lies onward and not back.' 58 | `That is true,' said Celeborn, `but is all this Company going with you 59 | to Minas Tirith? ' 60 | `We have not decided our course,' said Aragorn. 'Beyond Lothlurien I do 61 | not know what Gandalf intended to do. Indeed I do not think that even he had 62 | any clear purpose.' 63 | `Maybe not,' said Celeborn, `yet when you leave this land, you can no 64 | longer forget the Great River. As some of you know well, it cannot be 65 | crossed by travellers with baggage between Lurien and Gondor, save by boat. 66 | And are not the bridges of Osgiliath broken down and all the landings held 67 | now by the Enemy? 68 | `On which side will you journey? The way to Minas Tirith lies upon this 69 | side, upon the west; but the straight road of the Quest lies east of the 70 | River, upon the darker shore. Which shore will you now take? ' 71 | `If my advice is heeded, it will be the western shore, and the way to 72 | Minas Tirith,' answered Boromir. `But I am not the leader of the Company.' 73 | The others said nothing, and Aragorn looked doubtful and troubled. 74 | `I see that you do not yet know what to do,' said Celeborn. `It is not 75 | my part to choose for you; but I will help you as I may. There are some 76 | -------------------------------------------------------------------------------- /domains/lotr/data/rawtext/420.txt: -------------------------------------------------------------------------------- 1 | returned the glance, less in height and girth than most. He caught the glint 2 | of clear grey eyes; and then he shivered, for it came suddenly to him that 3 | it was the face of one without hope who goes in search of death. 4 | On down the grey road they went beside the Snowbourn rushing on its 5 | stones; through the hamlets of Underharrow and Upbourn, where many sad 6 | faces 7 | of women looked out from dark doors; and so without horn or harp or music of 8 | men's voices the great ride into the East began with which the songs of 9 | Rohan were busy for many long lives of men thereafter. 10 | From dark Dunharrow in the dim morning 11 | with thane and captain rode Thengel's son: 12 | to Edoras he came, the ancient halls 13 | of the Mark-wardens mist-enshrouded; 14 | golden timbers were in gloom mantled. 15 | Farewell he bade to his free people, 16 | hearth and high-seat, and the hallowed places, 17 | where long he had feasted ere the light faded. 18 | Forth rode the king, fear behind him, 19 | fate before him. Fealty kept he; 20 | oaths he had taken, all fulfilled them. 21 | Forth rode Thjoden. Five nights and days 22 | east and onward rode the Eorlingas 23 | through Folde and Fenmarch and the Firienwood, 24 | six thousand spears to Sunlending, 25 | Mundburg the mighty under Mindolluin, 26 | Sea-kings' city in the South-kingdom 27 | foe-beleaguered, fire-encircled. 28 | Doom drove them on. Darkness took them, 29 | Horse and horseman; hoofbeats afar 30 | sank into silence: so the songs tell us. 31 | It was indeed in deepening gloom that the king came to Edoras, although 32 | it was then but noon by the hour. There he halted only a short while and 33 | strengthened his host by some three score of Riders that came late to the 34 | weapontake. Now having eaten he made ready to set out again, and he wished 35 | his esquire a kindly farewell. But Merry begged for the last time not to be 36 | parted from him. 37 | 'This is no journey for such steeds as Stybba, as I have told you ' 38 | said Thjoden. 'And in such a battle as we think to make on the fields of 39 | Gondor what would you do, Master Meriadoc, sword-thain though you be, 40 | and 41 | greater of heart than of stature?' 42 | 'As for that, who can tell?' answered Merry. 'But why, lord, did you 43 | receive me as sword-thain, if not to stay by your side? And I would not have 44 | it said of me in song only that I was always left behind!' 45 | 'I received you for your safe-keeping,' answered Thjoden; 'and also to 46 | do as I might bid. None of my Riders can bear you as burden. If the battle 47 | were before my gates, maybe your deeds would be remembered by the 48 | minstrels; 49 | but it is a hundred leagues and two to Mundburg where Denethor is lord. I 50 | will say no more.' 51 | Merry bowed and went away unhappily, and stared at the lines of 52 | horsemen. Already the companies were preparing to start: men were tightening 53 | girths, looking to saddles, caressing their horses; some gazed uneasily at 54 | the lowering sky. Unnoticed a Rider came up and spoke softly in the hobbit's 55 | ear. 56 | ' Where will wants not, a way opens , so we say,' he whispered; 'and so I 57 | have found myself.' Merry looked up and saw that it was the young Rider 58 | whom 59 | he had noticed in the morning. 'You wish to go whither the Lord of the Mark 60 | goes: I see it in your face.' 61 | 'I do,' said Merry. 62 | 'Then you shall go with me,' said the Rider. 'I will bear you before 63 | me, under my cloak until we are far afield, and this darkness is yet darker. 64 | Such good will should not be denied. Say no more to any man, but come!' 65 | 'Thank you indeed!' said Merry. 'Thank you, sir, though I do not know 66 | your name.' 67 | 'Do you not?' said the Rider softly. 'Then call me Dernhelm.' 68 | Thus it came to pass that when the king set out, before Dernhelm sat 69 | Meriadoc the hobbit, and the great grey steed Windfola made little of the 70 | burden; for Dernhelm was less in weight than many men, though lithe and 71 | well-knit in frame. 72 | On into the shadow they rode. In the willow-thickets where Snowbourn 73 | flowed into Entwash, twelve leagues east of Edoras, they camped that night. 74 | And then on again through the Folde; and through the Fenmarch, where to 75 | their right great oakwoods climbed on the skirts of the hills under the 76 | shades of dark Halifirien by the borders of Gondor; but away to their left 77 | the mists lay on the marshes fed by the mouths of Entwash. And as they rode 78 | rumour came of war in the North. Lone men, riding wild, brought word of foes 79 | assailing their east-borders, of orc-hosts marching in the Wold of Rohan. 80 | 'Ride on! Ride on!' cried Jomer. 'Too late now to turn aside. The fens 81 | of Entwash must guard our flank. Haste now we need. Ride on!' 82 | And so King Thjoden departed from his own realm, and mile by mile the 83 | long road wound away, and the beacon hills marched past: Calenhad, 84 | Min-Rimmon, Erelas, Nardol. But their fires were quenched. All the lands 85 | were grey and still; and ever the shadow deepened before them, and hope 86 | waned in every heart. 87 | -------------------------------------------------------------------------------- /domains/lotr/data/rawtext/172.txt: -------------------------------------------------------------------------------- 1 | `A plain road, though it led through a hedge of swords,' said Boromir. 2 | `By strange paths has this Company been led, and so far to evil fortune. 3 | Against my will we passed under the shades of Moria, to our loss. And now we 4 | must enter the Golden Wood, you say. But of that perilous land we have heard 5 | in Gondor, and it is said that few come out who once go in; and of that few 6 | none have escaped unscathed.' 7 | `Say not unscathed , but if you say unchanged , then maybe you will speak 8 | the truth said Aragorn. But lore wanes in Gondor, Boromir, if in the city of 9 | those who once were wise they now speak evil of Lothlurien. Believe what you 10 | will, there is no other way for us -- unless you would go back to 11 | Moria-gate, or scale the pathless mountains, or swim the Great River all 12 | alone.' 13 | `Then lead on! ' said Boromir. `But it is perilous.' 14 | `Perilous indeed,' said Aragorn, 'fair and perilous; but only evil need 15 | fear it, or those who bring some evil with them. Follow me! ' 16 | They had gone little more than a mile into the forest when they came 17 | upon another stream flowing down swiftly from the tree-clad slopes that 18 | climbed back westward towards the mountains. They heard it splashing over a 19 | fall away among the shadows on their right. Its dark hurrying waters ran 20 | across the path before them, and joined the Silverlode in a swirl of dim 21 | pools among the roots of trees. 22 | `Here is Nimrodel! ' said Legolas. 'Of this stream the Silvan Elves 23 | made many songs long ago, and still we sing them in the North, remembering 24 | the rainbow on its falls, and the golden flowers that floated in its foam. 25 | All is dark now and the Bridge of Nimrodel is broken down. I will bathe my 26 | feet, for it is said that the water is healing to the weary.' He went 27 | forward and climbed down the deep-cloven bank and stepped into the stream. 28 | `Follow me!' he cried. 'The water is not deep. Let us wade across! On 29 | the further bank we can rest. and the sound of the falling water may bring 30 | us sleep and forgetfulness of grief.' 31 | One by one they climbed down and followed Legolas. For a moment Frodo 32 | stood near the brink and let the water flow over his tired feet. It was cold 33 | but its touch was clean, and as he went on and it mounted to his knees, he 34 | felt that the stain of travel and all weariness was washed from his limbs. 35 | When all the Company had crossed, they sat and rested and ate a little 36 | food; and Legolas told them tales of Lothlurien that the Elves of Mirkwood 37 | still kept in their hearts, of sunlight and starlight upon the meadows by 38 | the Great River before the world was grey. 39 | At length a silence fell, and they heard the music of the waterfall 40 | running sweetly in the shadows. Almost Frodo fancied that he could hear a 41 | voice singing, mingled with the sound of the water. 42 | `Do you hear the voice of Nimrodel? ' asked Legolas. 'I will sing you a 43 | song of the maiden Nimrodel, who bore the same name as the stream beside 44 | which she lived lung ago. It is a fair song in our woodland tongue; but this 45 | is how it runs in the Westron Speech, as some in Rivendell now sing it.' In 46 | a soft voice hardly to be heard amid the rustle of the leaves above them he 47 | began: 48 | An Elven-maid there was of old, 49 | A shining star by day: 50 | Her mantle white was hemmed with gold, 51 | Her shoes of silver-grey. 52 | A star was bound upon her brows, 53 | A light was on her hair 54 | As sun upon the golden boughs 55 | In Lurien the fair. 56 | Her hair was long, her limbs were white, 57 | And fair she was and free; 58 | And in the wind she went as light 59 | As leaf of linden-tree. 60 | Beside the falls of Nimrodel, 61 | By water clear and cool, 62 | Her voice as falling silver fell 63 | Into the shining pool. 64 | Where now she wanders none can tell, 65 | In sunlight or in shade; 66 | For lost of yore was Nimrodel 67 | And in the mountains strayed. 68 | The elven-ship in haven grey 69 | Beneath the mountain-lee 70 | Awaited her for many a day 71 | Beside the roaring sea. 72 | A wind by night in Northern lands 73 | Arose, and loud it cried, 74 | And drove the ship from elven-strands 75 | Across the streaming tide. 76 | When dawn came dim the land was lost, 77 | The mountains sinking grey 78 | Beyond the heaving waves that tossed 79 | Their plumes of blinding spray. 80 | Amroth beheld the fading shore 81 | Now low beyond the swell, 82 | And cursed the faithless ship that bore 83 | Him far from Nimrodel. 84 | Of old he was an Elven-king, 85 | A lord of tree and glen, 86 | When golden were the boughs in spring 87 | In fair Lothlurien. 88 | From helm to sea they saw him leap, 89 | As arrow from the string, 90 | And dive into the water deep, 91 | As mew upon the wing. 92 | The wind was in his flowing hair, 93 | The foam about him shone; 94 | Afar they saw him strong and fair 95 | Go riding like a swan. 96 | But from the West has come no word, 97 | And on the Hither Shore 98 | No tidings Elven-folk have heard 99 | Of Amroth evermore. 100 | -------------------------------------------------------------------------------- /domains/lotr/data/rawtext/43.txt: -------------------------------------------------------------------------------- 1 | dwindled into the foggy night. Suddenly Frodo laughed: from the covered 2 | basket he held, the scent of mushrooms was rising. 3 | Chapter 5. A Conspiracy Unmasked 4 | 'Now we had better get home ourselves,' said Merry. There's something 5 | funny about all this, I see; but it must wait till we get in.' 6 | They turned down the Ferry lane, which was straight and well-kept and 7 | edged with large white-washed stones. In a hundred yards or so it brought 8 | them to the river-bank, where there was a broad wooden landing-stage. A 9 | large flat ferry-boat was moored beside it. The white bollards near the 10 | water's edge glimmered in the light of two lamps on high posts. Behind them 11 | the mists in the flat fields were now above the hedges; but the water before 12 | them was dark, with only a few curling wisps like steam among the reeds by 13 | the bank. There seemed to be less fog on the further side. 14 | Merry led the pony over a gangway on to the ferry, and the others 15 | followed. Merry then pushed slowly off with a long pole. The Brandywine 16 | flowed slow and broad before them. On the other side the bank was steep, and 17 | up it a winding path climbed from the further landing. Lamps were twinkling 18 | there. Behind loomed up the Buck Hill; and out of it, through stray shrouds 19 | of mist, shone many round windows, yellow and red. They were the windows 20 | of 21 | Brandy Hall, the ancient home of the Brandybucks. 22 | Long ago Gorhendad Oldbuck, head of the Oldbuck family, one of the 23 | oldest in the Marish or indeed in the Shire, had crossed the river, which 24 | was the original boundary of the land eastwards. He built (and excavated) 25 | Brandy Hall, changed his name to Brandybuck, and settled down to become 26 | master of what was virtually a small independent country. His family grew 27 | and grew, and after his days continued to grow, until Brandy Hall occupied 28 | the whole of the low hill, and had three large front-doors, many side-doors, 29 | and about a hundred windows. The Brandybucks and their numerous 30 | dependants 31 | then began to burrow, and later to build, all round about. That was the 32 | origin of Buckland, a thickly inhabited strip between the river and the Old 33 | Forest, a sort of colony from the Shire. Its chief village was Bucklebury, 34 | clustering in the banks and slopes behind Brandy Hall. 35 | The people in the Marish were friendly with the Bucklanders, and the 36 | authority of the Master of the Hall (as the head of the Brandybuck family 37 | was called) was still acknowledged by the farmers between Stock and Rushey. 38 | But most of the folk of the old Shire regarded the Bucklanders as peculiar, 39 | half foreigners as it were. Though, as a matter of fact, they were not very 40 | different from the other hobbits of the Four Farthings. Except in one point: 41 | they were fond of boats, and some of them could swim. 42 | Their land was originally unprotected from the East; but on that side 43 | they had built a hedge: the High Hay. It had been planted many generations 44 | ago, and was now thick and tail, for it was constantly tended. It ran all 45 | the way from Brandywine Bridge, in a big loop curving away from the river, 46 | to Haysend (where the Withywindle flowed out of the Forest into the 47 | Brandywine): well over twenty miles from end to end. But, of course, it was 48 | not a complete protection. The Forest drew close to the hedge in many 49 | places. The Bucklanders kept their doors locked after dark, and that also 50 | was not usual in the Shire. 51 | The ferry-boat moved slowly across the water. The Buckland shore drew 52 | nearer. Sam was the only member of the party who had not been over the river 53 | before. He had a strange feeling as the slow gurgling stream slipped by: his 54 | old life lay behind in the mists, dark adventure lay in front. He scratched 55 | his head, and for a moment had a passing wish that Mr. Frodo could have gone 56 | on living quietly at Bag End. 57 | The four hobbits stepped off the ferry. Merry was tying it up, and 58 | Pippin was already leading the pony up the path, when Sam (who had been 59 | looking back, as if to take farewell of the Shire) said in a hoarse whisper: 60 | 'Look back, Mr. Frodo! Do you see anything?' 61 | On the far stage, under the distant lamps, they could just make out a 62 | figure: it looked like a dark black bundle left behind. But as they looked 63 | it seemed to move and sway this way and that, as if searching the ground. It 64 | then crawled, or went crouching, back into the gloom beyond the lamps. 65 | 'What in the Shire is that?' exclaimed Merry. 66 | 'Something that is following us,' said Frodo. 'But don't ask any more 67 | now! Let's get away at once!' They hurried up the path to the top of the 68 | bank, but when they looked back the far shore was shrouded in mist, and 69 | nothing could be seen. 70 | 'Thank goodness you don't keep any boats on the west-bank!' said Frodo. 71 | 'Can horses cross the river?' 72 | 'They can go twenty miles north to Brandywine Bridge - or they might 73 | swim,' answered Merry. 'Though I never heard of any horse swimming the 74 | -------------------------------------------------------------------------------- /domains/lotr/data/rawtext/380.txt: -------------------------------------------------------------------------------- 1 | But before he could overtake him, Gollum was gone. Then as the dark hole 2 | stood before him and the stench came out to meet him, like a clap of thunder 3 | the thought of Frodo and the monster smote upon Sam's mind. He spun round, 4 | and rushed wildly up the path, calling and calling his master's name. He was 5 | too late. So far Gollum's plot had succeeded. 6 | Chapter 10. The Choices of Master Samwise 7 | Frodo was lying face upward on the ground and the monster was bending 8 | over him, so intent upon her victim that she took no heed of Sam and his 9 | cries, until he was close at hand. As he rushed up he saw that Frodo was 10 | already bound in cords, wound about him from ankle to shoulder, and the 11 | monster with her great forelegs was beginning half to lift, half to drag his 12 | body away. 13 | On the near side of him lay, gleaming on the ground, his elven-blade, 14 | where it had fallen useless from his grasp. Sam did not wait to wonder what 15 | was to be done, or whether he was brave, or loyal, or filled with rage. He 16 | sprang forward with a yell, and seized his master's sword in his left hand. 17 | Then he charged. No onslaught more fierce was ever seen in the savage world 18 | of beasts; where some desperate small creature armed with little teeth 19 | alone, will spring upon a tower of horn and hide that stands above its 20 | fallen mate. 21 | Disturbed as if out of some gloating dream by his small yell she turned 22 | slowly the dreadful malice of her glance upon him. But almost before she was 23 | aware that a fury was upon her greater than any she had known in countless 24 | years, the shining sword bit upon her foot and shore away the claw. Sam 25 | sprang in, inside the arches of her legs, and with a quick upthrust of his 26 | other hand stabbed at the clustered eyes upon her lowered head. One great 27 | eye went dark. 28 | Now the miserable creature was right under her, for the moment out of 29 | the reach of her sting and of her claws. Her vast belly was above him with 30 | its putrid light, and the stench of it almost smote him down. Still his fury 31 | held for one more blow, and before she could sink upon him, smothering him 32 | and all his little impudence of courage, he slashed the bright elven-blade 33 | across her with desperate strength. 34 | But Shelob was not as dragons are, no softer spot had she save only her 35 | eyes. Knobbed and pitted with corruption was her age-old hide, but ever 36 | thickened from within with layer on layer of evil growth. The blade scored 37 | it with a dreadful gash, but those hideous folds could not be pierced by any 38 | strength of men, not though Elf or Dwarf should forge the steel or the hand 39 | of Beren or of T®rin wield it. She yielded to the stroke, and then heaved up 40 | the great bag of her belly high above Sam's head. Poison frothed and bubbled 41 | from the wound. Now splaying her legs she drove her huge bulk down on 42 | him 43 | again. Too soon. For Sam still stood upon his feet, and dropping his own 44 | sword, with both hands he held the elven-blade point upwards, fending off 45 | that ghastly roof; and so Shelob, with the driving force of her own cruel 46 | will, with strength greater than any warrior's hand, thrust herself upon a 47 | bitter spike. Deep, deep it pricked, as Sam was crushed slowly to the 48 | ground. 49 | No such anguish had Shelob ever known, or dreamed of knowing, in all 50 | her long world of wickedness. Not the doughtiest soldier of old Gondor, nor 51 | the most savage Orc entrapped, had ever thus endured her, or set blade to 52 | her beloved flesh. A shudder went through her. Heaving up again, wrenching 53 | away from the pain, she bent her writhing limbs beneath her and sprang 54 | backwards in a convulsive leap. 55 | Sam had fallen to his knees by Frodo's head, his senses reeling in the 56 | foul stench, his two hands still gripping the hilt of the sword. Through the 57 | mist before his eyes he was aware dimly of Frodo's face and stubbornly he 58 | fought to master himself and to drag himself out of the swoon that was upon 59 | him. Slowly he raised his head and saw her, only a few paces away, eyeing 60 | him, her beak drabbling a spittle of venom, and a green ooze trickling from 61 | below her wounded eye. There she crouched, her shuddering belly splayed 62 | upon 63 | the ground, the great bows of her legs quivering, as she gathered herself 64 | for another spring-this time to crush and sting to death: no little bite of 65 | poison to still the struggling of her meat; this time to slay and then to 66 | rend. 67 | Even as Sam himself crouched, looking at her, seeing his death in her 68 | eyes, a thought came to him, as if some remote voice had spoken. and he 69 | fumbled in his breast with his left hand, and found what he sought: cold and 70 | hard and solid it seemed to his touch in a phantom world of horror, the 71 | Phial of Galadriel. 72 | 'Galadriel! ' he said faintly, and then he heard voices far off but 73 | clear: the crying of the Elves as they walked under the stars in the beloved 74 | shadows of the Shire, and the music of the Elves as it came through his 75 | sleep in the Hall of Fire in the house of Elrond. 76 | Gilthoniel A Elbereth! 77 | -------------------------------------------------------------------------------- /domains/lotr/data/rawtext/271.txt: -------------------------------------------------------------------------------- 1 | Some held in readiness the king's horse, Snowmane, and others held the 2 | horses of Aragorn and Legolas. Gimli stood ill at ease, frowning, but Jomer 3 | came up to him, leading his horse. 4 | 'Hail, Gimli Gluin's son!' he cried. 'I have not had time to learn 5 | gentle speech under your rod, as you promised. But shall we not put aside 6 | our quarrel? At least I will speak no evil again of the Lady of the Wood.' 7 | 'I will forget my wrath for a while, Jomer son of Jomund,' said Gimli; 8 | 'but if ever you chance to see the Lady Galadriel with your eyes, then you 9 | shall acknowledge her the fairest of ladies, or our friendship will end.' 10 | 'So be it!' said Jomer. 'But until that time pardon me, and in token of 11 | pardon ride with me, I beg. Gandalf will be at the head with the Lord of the 12 | Mark; but Firefoot, my horse, will bear us both, if you will.' 13 | 'I thank you indeed,' said Gimli greatly pleased. 'I will gladly go 14 | with you, if Legolas, my comrade, may ride beside us.' 15 | 'It shall he so,' said Jomer. 'Legolas upon my left, and Aragorn upon 16 | my right, and none will dare to stand before us!' 17 | 'Where is Shadowfax?' said Gandalf. 18 | 'Running wild over the grass,' they answered. 'He will let no man 19 | handle him. There he goes, away down by the ford, like a shadow among the 20 | willows.' 21 | Gandalf whistled and called aloud the horse's name, and far away he 22 | tossed his head and neighed, and turning sped towards the host like an 23 | arrow. 24 | 'Were the breath of the West Wind to take a body visible, even so would 25 | it appear,' said Jomer, as the great horse ran up, until he stood before the 26 | wizard. 27 | 'The gift seems already to be given,' said Thjoden. 'But hearken all! 28 | Here now I name my guest, Gandalf Greyhame, wisest of counsellors; most 29 | welcome of wanderers, a lord of the Mark, a chieftain of the Eorlingas while 30 | our kin shall last; and I give to him Shadowfax, prince of horses.' 31 | 'I thank you, Thjoden King,' said Gandalf. Then suddenly he threw back 32 | his grey cloak, and cast aside his hat, and leaped to horseback. He wore no 33 | helm nor mail. His snowy hair flew free in the wind, his white robes shone 34 | dazzling in the sun. 35 | 'Behold the White Rider!' cried Aragorn, and all took up the words. 36 | 'Our King and the White Rider!' they shouted. 'Forth Eorlingas!' 37 | The trumpets sounded. The horses reared and neighed. Spear clashed on 38 | shield. Then the king raised his hand, and with a rush like the sudden onset 39 | of a great wind the last host of Rohan rode thundering into the West. Far 40 | over the plain Jowyn saw the glitter of their spears, as she stood still, 41 | alone before the doors of the silent house. 42 | Chapter 7. Helm's Deep 43 | The sun was already westering as they rode from Edoras, and the light 44 | of it was in their eyes, turning all the rolling fields of Rohan to a golden 45 | haze. There was a beaten way, north-westward along the foot-hills of the 46 | White Mountains, and this they followed, up and down in a green country, 47 | crossing small swift streams by many fords. Far ahead and to their right the 48 | Misty Mountains loomed; ever darker and taller they grew as the miles went 49 | by. The sun went slowly down before them. Evening came behind. 50 | The host rode on. Need drove them. Fearing to come too late, they rode 51 | with all the speed they could, pausing seldom. Swift and enduring were the 52 | steeds of Rohan, but there were many leagues to go. Forty leagues and more 53 | it was, as a bird flies, from Edoras to the fords of the Isen, where they 54 | hoped to find the king's men that held back the hosts of Saruman. 55 | Night closed about them. At last they halted to make their camp. They 56 | had ridden for some five hours and were far out upon the western plain, yet 57 | more than half their journey lay still before them. In a great circle, under 58 | the starry sky and the waxing moon, they now made their bivouac. They lit no 59 | fires, for they were uncertain of events; but they set a ring of mounted 60 | guards about them, and scouts rode out far ahead, passing like shadows in 61 | the folds of the land. The slow night passed without tidings or alarm. At 62 | dawn the horns sounded, and within an hour they took the road again. 63 | There were no clouds overhead yet, but a heaviness was in the air; it 64 | was hot for the season of the year. The rising sun was hazy, and behind it, 65 | following it slowly up the sky, there was a growing darkness, as of a great 66 | storm moving out of the East. And away in the North-west there seemed to be 67 | another darkness brooding about the feet of the Misty Mountains, a shadow 68 | that crept down slowly from the Wizard's Vale. 69 | Gandalf dropped back to where Legolas rode beside Jomer. 'You have the 70 | keen eyes of your fair kindred, Legolas,' he said; 'and they can tell a 71 | sparrow from a finch a league off. Tell me, can you sec anything away yonder 72 | towards Isengard?' 73 | 'Many miles lie between,' said Legolas, gazing thither and shading his 74 | eyes with his long hand. 'I can see a darkness. There are shapes moving in 75 | it, great shapes far away upon the bank of the river; but what they are I 76 | -------------------------------------------------------------------------------- /domains/lotr/data/rawtext/311.txt: -------------------------------------------------------------------------------- 1 | happened that I have at last understood, even as we ride together. But if I 2 | had spoken sooner, it would not have lessened your desire, or made it easier 3 | to resist. On the contrary! No, the burned hand teaches best. After that 4 | advice about fire goes to the heart.' 5 | 'It does,' said Pippin. 'If all the seven stones were laid out before 6 | me now, I should shut my eyes and put my hands in my pockets.' 7 | 'Good!' said Gandalf. 'That is what I hoped.' 8 | 'But I should like to know--' Pippin began. 9 | 'Mercy!' cried Gandalf. 'If the giving of information is to be the cure 10 | of your inquisitiveness, I shall spend all the rest of my days in answering 11 | you. What more do you want to know?' 12 | 'The names of all the stars, and of all living things, and the whole 13 | history of Middle-earth and Over-heaven and of the Sundering Seas ' laughed 14 | Pippin. 'Of course! What less? But I am not in a hurry tonight. At the 15 | moment I was just wondering about the black shadow. I heard you shout 16 | "messenger of Mordor". What was it? What could it do at Isengard?' 17 | 'It was a Black Rider on wings, a Nazgyl,' said Gandalf. 'It could have 18 | taken you away to the Dark Tower.' 19 | 'But it was not coming for me, was it?' faltered Pippin. 'I mean, it 20 | didn't know that I had... ' 21 | 'Of course not,' said Gandalf. 'It is two hundred leagues or more in 22 | straight flight from Barad-dyr to Orthanc, and even a Nazgyl would take a 23 | few hours to fly between them. But Saruman certainly looked in the Stone 24 | since the orc-raid, and more of his secret thought, I do not doubt, has been 25 | read than he intended. A messenger has been sent to find out what he is 26 | doing. And after what has happened tonight another will come, I think, and 27 | swiftly. So Saruman will come to the last pinch of the vice that he has put 28 | his hand in. He has no captive to send. He has no Stone to see with, and 29 | cannot answer the summons. Sauron will only believe that he is withholding 30 | the captive and refusing to use the Stone. It will not help Saruman to tell 31 | the truth to the messenger. For Isengard may be ruined, yet he is still safe 32 | in Orthanc. So whether he will or no, he will appear a rebel. Yet he 33 | rejected us, so as to avoid that very thing! What he will do in such a 34 | plight, I cannot guess. He has power still, I think, while in Orthanc, to 35 | resist the Nine Riders. He may try to do so. He may try to trap the Nazgyl, 36 | or at least to slay the thing on which it now rides the air. In that case 37 | let Rohan look to its horses! 38 | 'But I cannot tell how it will fall out, well or ill for us. It may be 39 | that the counsels of the Enemy will be confused, or hindered by his wrath 40 | with Saruman. It may be that he will learn that I was there and stood upon 41 | the stairs of Orthanc-with hobbits at my tail. Or that an heir of Elendil 42 | lives and stood beside me. If Wormtongue was not deceived by the armour of 43 | Rohan, he would remember Aragorn and the title that he claimed. That is what 44 | I fear. And so we fly -- not from danger but into greater danger. Every 45 | stride of Shadowfax bears you nearer to the Land of Shadow, Peregrin Took.' 46 | Pippin made no answer, but clutched his cloak, as if a sudden chill had 47 | struck him. Grey land passed under them. 48 | 'See now!' said Gandalf. 'The Westfold dales are opening before us. 49 | Here we come back to the eastward road. The dark shadow yonder is the 50 | mouth 51 | of the Deeping-coomb. That way lies Aglarond and the Glittering Caves. Do 52 | not ask me about them. Ask Gimli, if you meet again, and for the first time 53 | you may get an answer longer than you wish. You will not see the caves 54 | yourself, not on this journey. Soon they will be far behind.' 55 | 'I thought you were going to stop at Helm's Deep!' said Pippin. 'Where 56 | are you going then?' 57 | 'To Minas Tirith, before the seas of war surround it.' 58 | 'Oh! And how far is that?' 59 | 'Leagues upon leagues,' answered Gandalf. 'Thrice as far as the 60 | dwellings of King Thjoden, and they are more than a hundred miles east from 61 | here, as the messengers of Mordor fly. Shadowfax must run a longer road. 62 | Which will prove the swifter? 63 | 'We shall ride now till daybreak, and that is some hours away. Then 64 | even Shadowfax must rest, in some hollow of the hills: at Edoras, I hope. 65 | Sleep, if you can! You may see the first glimmer of dawn upon the golden 66 | roof of the house of Eorl. And in two days thence you shall see the purple 67 | shadow of Mount Mindolluin and the walls of the tower of Denethor white in 68 | the morning. 69 | 'Away now, Shadowfax! Run, greatheart, run as you have never run 70 | before! Now we are come to the lands where you were foaled and every stone 71 | you know. Run now! Hope is in speed!' 72 | Shadowfax tossed his head and cried aloud, as if a trumpet had summoned 73 | him to battle. Then he sprang forward. Fire flew from his feet; night rushed 74 | over him. 75 | As he fell slowly into sleep, Pippin had a strange feeling: he and 76 | Gandalf were still as stone, seated upon the statue of a running horse, 77 | while the world rolled away beneath his feet with a great noise of wind. 78 | -------------------------------------------------------------------------------- /domains/lotr/data/rawtext/85.txt: -------------------------------------------------------------------------------- 1 | talked for a little, for Merry still had several questions to ask. 2 | 'Jumped over the Moon!' chuckled Merry as he rolled himself in his 3 | blanket. 'Very ridiculous of you, Frodo! But I wish I had been there to see. 4 | The worthies of Bree will be discussing it a hundred years hence.' 5 | 'I hope so,' said Strider. Then they all fell silent, and one by one 6 | the hobbits dropped off to sleep. 7 | Chapter 11. A Knife in the Dark 8 | As they prepared for sleep in the inn at Bree, darkness lay on 9 | Buckland; a mist strayed in the dells and along the river-bank. The house at 10 | Crickhollow stood silent. Fatty Bolger opened the door cautiously and peered 11 | out. A feeling of fear had been growing on him all day, and he was unable to 12 | rest or go to bed: there was a brooding threat in the breathless night-air. 13 | As he stared out into the gloom, a black shadow moved under the trees; the 14 | gate seemed to open of its own accord and close again without a sound. 15 | Terror seized him. He shrank back, and for a moment he stood trembling in 16 | the hall. Then he shut and locked the door. 17 | The night deepened. There came the soft sound of horses led with 18 | stealth along the lane. Outside the gate they stopped, and three black 19 | figures entered, like shades of night creeping across the ground. One went 20 | to the door, one to the corner of the house on either side; and there they 21 | stood, as still as the shadows of stones, while night went slowly on. The 22 | house and the quiet trees seemed to be waiting breathlessly. 23 | There was a faint stir in the leaves, and a cock crowed far away. The 24 | cold hour before dawn was passing. The figure by the door moved. In the dark 25 | without moon or stars a drawn blade gleamed, as if a chill light had been 26 | unsheathed. There was a blow, soft but heavy, and the door shuddered. 27 | 'Open, in the name of Mordor!' said a voice thin and menacing. 28 | At a second blow the door yielded and fell back, with timbers burst and 29 | lock broken. The black figures passed swiftly in. 30 | At that moment, among the trees nearby, a horn rang out. It rent the 31 | night like fire on a hill-top. 32 | AWAKE! FEAR! FIRE! FOES! AWAKE! 33 | Fatty Bolger had not been idle. As soon as he saw the dark shapes creep 34 | from the garden, he knew that he must run for it, or perish. And run he did, 35 | out of the back door, through the garden, and over the fields. When he 36 | reached the nearest house, more than a mile away, he collapsed on the 37 | doorstep. 'No, no, no!' he was crying. 'No, not me! I haven't got it!' It 38 | was some time before anyone could make out what he was babbling about. 39 | At 40 | last they got the idea that enemies were in Buckland, some strange invasion 41 | from the Old Forest. And then they lost no more time. 42 | FEAR! FIRE! FOES! 43 | The Brandybucks were blowing the Horn-call of Buckland, that had not 44 | been sounded for a hundred years, not since the white wolves came in the 45 | Fell Winter, when the Brandywine was frozen over. 46 | AWAKE! AWAKE! 47 | Far-away answering horns were heard. The alarm was spreading. The black 48 | figures fled from the house. One of them let fall a hobbit-cloak on the 49 | step, as he ran. In the lane the noise of hoofs broke out, and gathering to 50 | a gallop, went hammering away into the darkness. All about Crickhollow there 51 | was the sound of horns blowing, and voices crying and feet running. But the 52 | Black Riders rode like a gale to the North-gate. Let the little people blow! 53 | Sauron would deal with them later. Meanwhile they had another errand: they 54 | knew now that the house was empty and the Ring had gone. They rode down 55 | the 56 | guards at the gate and vanished from the Shire. 57 | In the early night Frodo woke from deep sleep, suddenly, as if some 58 | sound or presence had disturbed him. He saw that Strider was sitting alert 59 | in his chair: his eyes gleamed in the light of the fire, which had been 60 | tended and was burning brightly; but he made no sign or movement. 61 | Frodo soon went to sleep again; but his dreams were again troubled with 62 | the noise of wind and of galloping hoofs. The wind seemed to be curling 63 | round the house and shaking it; and far off he heard a horn blowing wildly. 64 | He opened his eyes, and heard a cock crowing lustily in the inn-yard. 65 | Strider had drawn the curtains and pushed back the shutters with a clang. 66 | The first grey light of day was in the room, and a cold air was coming 67 | through the open window. 68 | As soon as Strider had roused them all, he led the way to their 69 | bedrooms. When they saw them they were glad that they had taken his advice: 70 | the windows had been forced open and were swinging, and the curtains were 71 | flapping; the beds were tossed about, and the bolsters slashed and flung 72 | upon the floor; the brown mat was torn to pieces. 73 | Strider immediately went to fetch the landlord. Poor Mr. Butterbur 74 | looked sleepy and frightened. He had hardly closed his eyes all night (so he 75 | said), but he had never heard a sound. 76 | 'Never has such a thing happened in my time!' he cried, raising his 77 | hands in horror. 'Guests unable to sleep in their beds, and good bolsters 78 | -------------------------------------------------------------------------------- /domains/lotr/data/rawtext/280.txt: -------------------------------------------------------------------------------- 1 | the hosts of Isengard as a wind among grass. Behind them from the Deep came 2 | the stern cries of' men issuing from the caves, driving forth the enemy. Out 3 | poured all the men that were left upon the Rock. And ever the sound of 4 | blowing horns echoed in the hills. 5 | On they rode, the king and his companions. Captains and champions fell 6 | or fled before them. Neither orc nor man withstood them. Their backs were to 7 | the swords and spears of the Riders and their faces to the valley. They 8 | cried and wailed, for fear and great wonder had come upon them with the 9 | rising of the day. 10 | So King Thjoden rode from Helm's Gate and clove his path to the great 11 | Dike. There the company halted. Light grew bright about them. Shafts of the 12 | sun flared above the eastern hills and glimmered on their spears. But they 13 | sat silent on their horses, and they gazed down upon the Deeping-coomb. 14 | The land had changed. Where before the green dale had lain, its grassy 15 | slopes lapping the ever-mounting hills, there now a forest loomed. Great 16 | trees, bare and silent, stood, rank on rank, with tangled bough and hoary 17 | head; their twisted roots were buried in the long green grass. Darkness was 18 | under them. Between the Dike and the eaves of that nameless wood only two 19 | open furlongs lay. There now cowered the proud hosts of Saruman, in terror 20 | of the king and in terror of the trees. They streamed down from Helm's Gate 21 | until all above the Dike was empty of them, but below it they were packed 22 | like swarming flies. Vainly they crawled and clambered about the walls of 23 | the coomb. seeking to escape. Upon the east too sheer and stony was the 24 | valley's side; upon the left, from the west, their final doom approached. 25 | There suddenly upon a ridge appeared a rider, clad in white, shining in 26 | the rising sun. Over the low hills the horns were sounding. Behind him, 27 | hastening down the long slopes, were a thousand men on foot; their swords 28 | were in their hands. Amid them strode a man tall and strong. His shield was 29 | red. As he came to the valley's brink, he set to his lips a great black horn 30 | and blew a ringing blast. 31 | 'Erkenbrand!' the Riders shouted. 'Erkenbrand!' 32 | 'Behold the White Rider!' cried Aragorn. 'Gandalf is come again!' 33 | 'Mithrandir, Mithrandir!' said Legolas. 'This is wizardry indeed! Come! 34 | I would look on this forest, ere the spell changes.' 35 | The hosts of Isengard roared, swaying this way and that, turning from 36 | fear to fear. Again the horn sounded from the tower. Down through the breach 37 | of the Dike charged the king's company. Down from the hills leaped 38 | Erkenbrand, lord of Westfold. Down leaped Shadowfax, like a deer that runs 39 | surefooted in the mountains. The White Rider was upon them, and the terror 40 | of his coming filled the enemy with madness. The wild men fell on their 41 | faces before him. The Orcs reeled and screamed and cast aside both sword and 42 | spear. Like a black smoke driven by a mounting wind they fled. Wailing they 43 | passed under the waiting shadow of the trees; and from that shadow none ever 44 | came again. 45 | Chapter 8. The Road to Isengard 46 | So it was that in the light of a fair morning King Thjoden and Gandalf 47 | the White Rider met again upon the green grass beside the Deeping-stream. 48 | There was also Aragorn son of Arathorn, and Legolas the Elf, and Erkenbrand 49 | of Westfold, and the lords of the Golden House. About them were gathered the 50 | Rohirrim, the Riders of the Mark: wonder overcame their joy in victory, and 51 | their eyes were turned towards the wood. 52 | Suddenly there was a great shout, and down from the Dike came those who 53 | had been driven back into the Deep. There came Gamling the Old, and Jomer 54 | son of Jomund, and beside them walked Gimli the dwarf. He had no helm, 55 | and 56 | about his head was a linen band stained with blood; but his voice was loud 57 | and strong. 58 | 'Forty-two, Master Legolas!' he cried. 'Alas! My axe is notched: the 59 | forty-second had an iron collar on his neck. How is it with you?' 60 | 'You have passed my score by one,' answered Legolas. 'But I do not 61 | grudge you the game, so glad am I to see you on your legs!' 62 | 'Welcome, Jomer, sister-son!' said Thjoden. 'Now that I see you safe, I 63 | am glad indeed.' 64 | 'Hail, Lord of the Mark!' said Jomer. 'The dark night has passed and 65 | day has come again. But the day has brought strange tidings.' He turned and 66 | gazed in wonder, first at the wood and then at Gandalf. 'Once more you come 67 | in the hour of need, unlooked-for,' he said. 68 | 'Unlooked-for?' said Gandalf. 'I said that I would return and meet you 69 | here.' 70 | 'But you did not name the hour, nor foretell the manner of your coming. 71 | Strange help you bring. You are mighty in wizardry, Gandalf the White!' 72 | 'That may be. But if so, I have not shown it yet. I have but given good 73 | counsel in peril, and made use of the speed of Shadowfax. Your own valour 74 | has done more, and the stout legs of the Westfold-men marching through the 75 | night.' 76 | Then they all gazed at Gandalf with still greater wonder. Some glanced 77 | darkly at the wood, and passed their hands over their brows, as if they 78 | thought their eyes saw otherwise than his. 79 | -------------------------------------------------------------------------------- /domains/lotr/data/rawtext/42.txt: -------------------------------------------------------------------------------- 1 | candles and the fire was mended. Mrs. Maggot hustled in and out. One or two 2 | other hobbits belonging to the farm-household came in. In a short while 3 | fourteen sat down to eat. There was beer in plenty, and a mighty dish of 4 | mushrooms and bacon, besides much other solid farmhouse fare. The dogs lay 5 | by the fire and gnawed rinds and cracked bones. 6 | When they had finished, the farmer and his sons went out with a lantern 7 | and got the waggon ready. It was dark in the yard, when the guests came out. 8 | They threw their packs on board and climbed in. The farmer sat in the 9 | driving-seat, and whipped up his two stout ponies. His wife stood in the 10 | light of the open door. 11 | 'You be careful of yourself. Maggot!' she called. 'Don't go arguing 12 | with any foreigners, and come straight back!' 13 | 'I will!' said he, and drove out of the gate. There was now no breath 14 | of wind stirring; the night was still and quiet, and a chill was in the air. 15 | They went without lights and took it slowly. After a mile or two the lane 16 | came to an end, crossing a deep dike, and climbing a short slope up on to 17 | the high-banked causeway. 18 | Maggot got down and took a good look either way, north and south, but 19 | nothing could be seen in the darkness, and there was not a sound in the 20 | still air. Thin strands of river-mist were hanging above the dikes, and 21 | crawling over the fields. 22 | 'It's going to be thick,' said Maggot; 'but I'll not light my lantern 23 | till I turn for home. We'll hear anything on the road long before we meet it 24 | tonight.' 25 | It was five miles or more from Maggot's lane to the Ferry. The hobbits 26 | wrapped themselves up, but their ears were strained for any sound above the 27 | creak of the wheels and the slow clop of the ponies' hoofs. The waggon 28 | seemed slower than a snail to Frodo. Beside him Pippin was nodding towards 29 | sleep; but Sam was staring forwards into the rising fog. 30 | They reached the entrance to the Ferry lane at last. It was marked by 31 | two tall white posts that suddenly loomed up on their right. Farmer Maggot 32 | drew in his ponies and the waggon creaked to a halt. They were just 33 | beginning lo scramble out, when suddenly they heard what they had all been 34 | dreading: hoofs on the road ahead. The sound was coming towards them. 35 | Maggot jumped down and stood holding the ponies' heads, and peering 36 | forward into the gloom. Clip-clop, clip-clop came the approaching rider. The 37 | fall of the hoofs sounded loud in the still, foggy air. 38 | 'You'd better be hidden, Mr. Frodo,' said Sam anxiously. 'You get down 39 | in the waggon and cover up with blankets, and we'll send this rider to the 40 | rightabouts!' He climbed out and went to the farmer's side. Black Riders 41 | would have to ride over him to get near the waggon. 42 | Clop-clop, clop-clop. The rider was nearly on them. 43 | 'Hallo there!' called Farmer Maggot. The advancing hoofs stopped short. 44 | They thought they could dimly guess a dark cloaked shape in the mist, a yard 45 | or two ahead. 'Now then!' said the farmer, throwing the reins to Sam and 46 | striding forward. 'Don't you come a step nearer! What do you want, and where 47 | are you going?' 48 | 'I want Mr. Baggins. Have you seen him?' said a muffled voice - but the 49 | voice was the voice of Merry Brandybuck. A dark lantern was uncovered, and 50 | its light fell on the astonished face of the farmer. 51 | 'Mr. Merry!' he cried. 52 | 'Yes, of course! Who did you think it was?' said Merry coming forward. 53 | As he came out of the mist and their fears subsided, he seemed suddenly to 54 | diminish to ordinary hobbit-size. He was riding a pony, and a scarf was 55 | swathed round his neck and over his chin to keep out the fog. 56 | Frodo sprang out of the waggon to greet him. 'So there you are at 57 | last!' said Merry. 'I was beginning to wonder if you would turn up at all 58 | today, and I was just going back to supper. When it grew foggy I came across 59 | and rode up towards Stock to see if you had fallen in any ditches. But I'm 60 | blest if I know which way you have come. Where did you find them, Mr. 61 | Maggot? In your duck-pond?' 62 | 'No, I caught 'em trespassing,' said the farmer, 'and nearly set my 63 | dogs on 'em; but they'll tell you all the story, I've no doubt. Now, if 64 | you'll excuse me, Mr. Merry and Mr. Frodo and all, I'd best be turning for 65 | home. Mrs. Maggot will be worriting with the night getting thick.' 66 | He backed the waggon into the lane and turned it. 'Well, good night to 67 | you all,' he said. 'It's been a queer day, and no mistake. But all's well as 68 | ends well; though perhaps we should not say that until we reach our own 69 | doors. I'll not deny that I'll be glad now when I do.' He lit his lanterns, 70 | and got up. Suddenly he produced a large basket from under the seat. 'I was 71 | nearly forgetting,' he said. 'Mrs. Maggot put this up for Mr. Baggins, with 72 | her compliments.' He handed it down and moved off, followed by a chorus of 73 | thanks and good-nights. 74 | They watched the pale rings of light round his lanterns as they 75 | dwindled into the foggy night. Suddenly Frodo laughed: from the covered 76 | basket he held, the scent of mushrooms was rising. 77 | -------------------------------------------------------------------------------- /domains/lotr/data/rawtext/84.txt: -------------------------------------------------------------------------------- 1 | not come back, I went out for a stroll. I had come back again and was 2 | standing just outside the light of the lamp looking at the stars. Suddenly I 3 | shivered and felt that something horrible was creeping near: there was a son 4 | of deeper shade among the shadows across the road, just beyond the edge of 5 | the lamplight. It slid away at once into the dark without a sound. There was 6 | no horse.' 7 | 'Which way did it go?' asked Strider, suddenly and sharply. Merry 8 | started, noticing the stranger for the first time. 'Go on!' said Frodo. 9 | 'This is a friend of Gandalf's. I will explain later.' 10 | 'It seemed to make off up the Road, eastward,' continued Merry. 'I 11 | tried to follow. Of course, it vanished almost at once; but I went round the 12 | corner and on as far as the last house on the Road.' 13 | Strider looked at Merry with wonder. 'You have a stout heart,' he said; 14 | 'but it was foolish.' 15 | 'I don't know,' said Merry. 'Neither brave nor silly, I think. I could 16 | hardly help myself. I seemed to be drawn somehow. Anyway, I went, and 17 | suddenly I heard voices by the hedge. One was muttering; and the other was 18 | whispering, or hissing. I couldn't hear a word that was said. I did not 19 | creep any closer, because I began to tremble all over. Then I felt 20 | terrified, and I turned back, and was just going to bolt home, when 21 | something came behind me and I... I fell over.' 22 | 'I found him, sir,' put in Nob. 'Mr. Butterbur sent me out with a 23 | lantern. I went down to West-gate, and then back up towards South-gate. Just 24 | nigh Bill Ferny's house I thought I could see something in the Road. I 25 | couldn't swear to it, but it looked to me as if two men was stooping over 26 | something, lilting it. I gave a shout, but where I got up to the spot there 27 | was no signs of them, and only Mr. Brandybuck lying by the roadside. He 28 | seemed to be asleep. "I thought I had fallen into deep water," he says to 29 | me, when I shook him. Very queer he was, and as soon as I had roused him, he 30 | got up and ran back here like a hare.' 31 | 'I am afraid that's true,' said Merry, 'though I don't know what I 32 | said. I had an ugly dream, which I can't remember. I went to pieces. I don't 33 | know what came over me.' 34 | 'I do,' said Strider. 'The Black Breath. The Riders must have left 35 | their horses outside, and passed back through the South-gate in secret. They 36 | will know all the news now, for they have visited Bill Ferny; and probably 37 | that Southerner was a spy as well. Something may happen in the night, before 38 | we leave Bree.' 39 | 'What will happen?' said Merry. 'Will they attack the inn?' 'No, I 40 | think not,' said Strider. 'They are not all here yet. And in any case that 41 | is not their way. In dark and loneliness they are strongest; they will not 42 | openly attack a house where there are lights and many people -not until they 43 | are desperate, not while all the long leagues of Eriador still lie before 44 | us. But their power is in terror, and already some in Bree are in their 45 | clutch. They will drive these wretches to some evil work: Ferny, and some of 46 | the strangers, and, maybe, the gatekeeper too. They had words with Harry at 47 | West-gate on Monday. I was watching them. He was white and shaking when 48 | they 49 | left him.' 50 | 'We seem to have enemies all round,' said Frodo. 'What are we to do?' 51 | 'Stay here, and do not go to your rooms! They are sure to have found 52 | out which those are. The hobbit-rooms have windows looking north and close 53 | to the ground. We will all remain together and bar this window and the door. 54 | But first Nob and I will fetch your luggage.' 55 | While Strider was gone, Frodo gave Merry a rapid account of all that 56 | had happened since supper. Merry was still reading and pondering Gandalf's 57 | letter when Strider and Nob returned. 58 | 'Well Masters,' said Nob, 'I've ruffled up the clothes and put in a 59 | bolster down the middle of each bed. And I made a nice imitation of your 60 | head with a brown woollen mat, Mr. Bag - Underhill, sir,' he added with a 61 | grin. 62 | Pippin laughed. 'Very life-like!' he said. 'But what will happen when 63 | they have penetrated the disguise?' 64 | 'We shall see,' said Strider. 'Let us hope to hold the fort till 65 | morning.' 66 | 'Good night to you,' said Nob, and went off to take his part in the 67 | watch on the doors. 68 | Their bags and gear they piled on the parlour-floor. They pushed a low 69 | chair against the door and shut the window. Peering out, Frodo saw that the 70 | night was still clear. The Sickle was swinging bright above the shoulders of 71 | Bree-hill. He then closed and barred the heavy inside shutters and drew the 72 | curtains together. Strider built up the fire and blew out all the candles. 73 | The hobbits lay down on their blankets with their feet towards the 74 | hearth; but Strider settled himself in the chair against the door. They 75 | talked for a little, for Merry still had several questions to ask. 76 | 'Jumped over the Moon!' chuckled Merry as he rolled himself in his 77 | blanket. 'Very ridiculous of you, Frodo! But I wish I had been there to see. 78 | The worthies of Bree will be discussing it a hundred years hence.' 79 | 'I hope so,' said Strider. Then they all fell silent, and one by one 80 | the hobbits dropped off to sleep. 81 | -------------------------------------------------------------------------------- /domains/lotr/data/rawtext/168.txt: -------------------------------------------------------------------------------- 1 | `Gondor! ' cried Boromir and leaped after him. 2 | At that moment Gandalf lifted his staff, and crying aloud he smote the 3 | bridge before him. The staff broke asunder and fell from his hand. A 4 | blinding sheet of white flame sprang up. The bridge cracked. Right at the 5 | Balrog's feet it broke, and the stone upon which it stood crashed into the 6 | gulf, while the rest remained, poised, quivering like a tongue of rock 7 | thrust out into emptiness. 8 | With a terrible cry the Balrog fell forward, and its shadow plunged 9 | down and vanished. But even as it fell it swung its whip, and the thongs 10 | lashed and curled about the wizard's knees, dragging him to the brink. He 11 | staggered and fell, grasped vainly at the stone, and slid into the abyss. 12 | 'Fly, you fools! ' he cried, and was gone. 13 | The fires went out, and blank darkness fell. The Company stood rooted 14 | with horror staring into the pit. Even as Aragorn and Boromir came flying 15 | back, the rest of the bridge cracked and fell. With a cry Aragorn roused 16 | them. 17 | 'Come! I will lead you now! ' he called. 'We must obey his last 18 | command. Follow me! ' 19 | They stumbled wildly up the great stairs beyond the door. Aragorn 20 | leading, Boromir at the rear. At the top was a wide echoing passage. Along 21 | this they fled. Frodo heard Sam at his side weeping, and then he found that 22 | he himself was weeping as he ran. Doom, doom, doom the drum-beats rolled 23 | behind, mournful now and slow; doom! 24 | They ran on. The light grew before them; great shafts pierced the roof. 25 | They ran swifter. They passed into a hall, bright with daylight from its 26 | high windows in the east. They fled across it. Through its huge broken doors 27 | they passed, and suddenly before them the Great Gates opened, an arch of 28 | blazing light. 29 | There was a guard of orcs crouching in the shadows behind the great 30 | door posts towering on either side, but the gates were shattered and cast 31 | down. Aragorn smote to the ground the captain that stood in his path, and 32 | the rest fled in terror of his wrath. The Company swept past them and took 33 | no heed of them. Out of the Gates they ran and sprang down the huge and 34 | age-worn steps, the threshold of Moria. 35 | Thus, at last, they came beyond hope under the sky and felt the wind on 36 | their faces. 37 | They did not halt until they were out of bowshot from the walls. 38 | Dimrill Dale lay about them. The shadow of the Misty Mountains lay upon it, 39 | but eastwards there was a golden light on the land. It was but one hour 40 | after noon. The sun was shining; the clouds were white and high. 41 | They looked back. Dark yawned the archway of the Gates under the 42 | mountain-shadow. Faint and far beneath the earth rolled the slow drum-beats: 43 | doom . A thin black smoke trailed out. Nothing else was to be seen; the dale 44 | all around was empty. Doom . Grief at last wholly overcame them, and they 45 | wept long: some standing and silent, some cast upon the ground. Doom, doom . 46 | The drum-beats faded. 47 | Chapter 6. Lothlurien 48 | 'Alas! I Fear we cannot stay here longer,' said Aragorn. He looked 49 | towards the mountains and held up his sword. `Farewell, Gandalf! ' he cried. 50 | 'Did I not say to you: if you pass the doors of Moria, beware ? Alas that I 51 | spoke true! What hope have we without you? ' 52 | He turned to the Company. `We must do without hope,' he said. `At least 53 | we may yet be avenged. Let us gird ourselves and weep no more! Come! We 54 | have 55 | a long road, and much to do.' 56 | They rose and looked about them. Northward the dale ran up into a glen 57 | of shadows between two great arms of the mountains, above which three white 58 | peaks were shining: Celebdil, Fanuidhol, Caradhras. the Mountains of Moria. 59 | At the head of the glen a torrent flowed like a white lace over an endless 60 | ladder of short falls, and a mist of foam hung in the air about the 61 | mountains' feet. 62 | `Yonder is the Dimrill Stair,' said Aragorn, pointing to the falls. 63 | 'Down the deep-cloven way that climbs beside the torrent we should have 64 | come, if fortune had been kinder.' 65 | `Or Caradhras less cruel,' said Gimli. `There he stands smiling in the 66 | sun! ' He shook his fist at the furthest of the snow-capped peaks and turned 67 | away. 68 | To the east the outflung arm of the mountains marched to a sudden end, 69 | and far lands could be descried beyond them, wide and vague. To the south 70 | the Misty Mountains receded endlessly as far as sight could reach. Less than 71 | a mile away, and a little below them, for they still stood high up on the 72 | west side of the dale, there lay a mere. It was long and oval, shaped like a 73 | great spear-head thrust deep into the northern glen; but its southern end 74 | was beyond the shadows under the sunlit sky. Yet its waters were dark: a 75 | deep blue like clear evening sky seen from a lamp-lit room. Its face was 76 | still and unruffled. About it lay a smooth sward, shelving down on all sides 77 | to its bare unbroken rim. 78 | `There lies the Mirrormere, deep Kheled-zvram! ' said Gimli sadly. `I 79 | remember that he said: "May you have joy of the sight! But we cannot linger 80 | there." Now long shall I journey ere I have joy again. It is I that must 81 | -------------------------------------------------------------------------------- /domains/lotr/data/rawtext/94.txt: -------------------------------------------------------------------------------- 1 | And light of stars was in her hair, 2 | And in her raiment glimmering. 3 | There Beren came from mountains cold, 4 | And lost he wandered under leaves, 5 | And where the Elven-river rolled 6 | He walked alone and sorrowing. 7 | He peered between the hemlock-leaves 8 | And saw in wander flowers of gold 9 | Upon her mantle and her sleeves, 10 | And her hair like shadow following. 11 | Enchantment healed his weary feet 12 | That over hills were doomed to roam; 13 | And forth he hastened, strong and fleet, 14 | And grasped at moonbeams glistening. 15 | Through woven woods in Elvenhome 16 | She tightly fled on dancing feet, 17 | And left him lonely still to roam 18 | In the silent forest listening. 19 | He heard there oft the flying sound 20 | Of feet as light as linden-leaves, 21 | Or music welling underground, 22 | In hidden hollows quavering. 23 | Now withered lay the hemlock-sheaves, 24 | And one by one with sighing sound 25 | Whispering fell the beechen leaves 26 | In the wintry woodland wavering. 27 | He sought her ever, wandering far 28 | Where leaves of years were thickly strewn, 29 | By light of moon and ray of star 30 | In frosty heavens shivering. 31 | Her mantle glinted in the moon, 32 | As on a hill-top high and far 33 | She danced, and at her feet was strewn 34 | A mist of silver quivering. 35 | When winter passed, she came again, 36 | And her song released the sudden spring, 37 | Like rising lark, and falling rain, 38 | And melting water bubbling. 39 | He saw the elven-flowers spring 40 | About her feet, and healed again 41 | He longed by her to dance and sing 42 | Upon the grass untroubling. 43 | Again she fled, but swift he came. 44 | Tin®viel! Tin®viel! 45 | He called her by her elvish name; 46 | And there she halted listening. 47 | One moment stood she, and a spell 48 | His voice laid on her: Beren came, 49 | And doom fell on Tin®viel 50 | That in his arms lay glistening. 51 | As Beren looked into her eyes 52 | Within the shadows of her hair, 53 | The trembling starlight of the skies 54 | He saw there mirrored shimmering. 55 | Tin®viel the elven-fair, 56 | Immortal maiden elven-wise, 57 | About him cast her shadowy hair 58 | And arms like silver glimmering. 59 | Long was the way that fate them bore, 60 | O'er stony mountains cold and grey, 61 | Through halls of iron and darkling door, 62 | And woods of nightshade morrowless. 63 | The Sundering Seas between them lay, 64 | And yet at last they met once more, 65 | And long ago they passed away 66 | In the forest singing sorrowless. 67 | Strider sighed and paused before he spoke again. 'That is a song,' he 68 | said, 'in the mode that is called ann-thennath among the Elves, but is hard 69 | to render in our Common Speech, and this is but a rough echo of it. It tells 70 | of the meeting of Beren son of Barahir and L®thien Tin®viel. Beren was a 71 | mortal man, but L®thien was the daughter of Thingol, a King of Elves upon 72 | Middle-earth when the world was young; and she was the fairest maiden that 73 | has ever been among all the children of this world. As the stars above the 74 | mists of the Northern lands was her loveliness, and in her face was a 75 | shining light. In those days the Great Enemy, of whom Sauron of Mordor was 76 | but a servant, dwelt in Angband in the North, and the Elves of the West 77 | coming back to Middle-earth made war upon him to regain the Silmarils which 78 | he had stolen; and the fathers of Men aided the Elves. But the Enemy was 79 | victorious and Barahir was slain, and Beren escaping through great peril 80 | came over the Mountains of Terror into the hidden Kingdom of Thingol in the 81 | forest of Neldoreth. There he beheld L®thien singing and dancing in a glade 82 | beside the enchanted river Esgalduin; and he named her Tin®viel, that is 83 | Nightingale in the language of old. Many sorrows befell them afterwards, and 84 | they were parted long. Tin®viel rescued Beren from the dungeons of Sauron, 85 | and together they passed through great dangers, and cast down even the Great 86 | Enemy from his throne, and took from his iron crown one of the three 87 | Silmarils, brightest of all jewels, to be the bride-price of L®thien to 88 | Thingol her father. Yet at the last Beren was slain by the Wolf that came 89 | from the gates of Angband, and he died in the arms of Tin®viel. But she 90 | chose mortality, and to die from the world, so that she might follow him; 91 | and it is sung that they met again beyond the Sundering Seas, and after a 92 | brief time walking alive once more in the green woods, together they passed, 93 | long ago, beyond the confines of this world. So it is that L®thien Tin®viel 94 | alone of the Elf-kindred has died indeed and left the world, and they have 95 | lost her whom they most loved. But from her the lineage of the Elf-lords of 96 | old descended among Men. There live still those of whom L®thien was the 97 | foremother, and it is said that her line shall never fail. Elrond of 98 | Rivendell is of that Kin. For of Beren and L®thien was born Dior Thingol's 99 | heir; and of him Elwing the White whom Edrendil wedded, he that sailed his 100 | ship out of the mists of the world into the seas of heaven with the Silmaril 101 | upon his brow. And of Edrendil came the Kings of N®menor, that is 102 | Westernesse.' 103 | As Strider was speaking they watched his strange eager face, dimly lit 104 | -------------------------------------------------------------------------------- /domains/lotr/data/rawtext/35.txt: -------------------------------------------------------------------------------- 1 | doubt that you will find what you seek, or accomplish what you intend, or 2 | that you will ever return. Is not that so?' 3 | 'It is,' said Frodo; 'but I thought my going was a secret known only to 4 | Gandalf and my faithful Sam.' He looked down at Sam, who was snoring 5 | gently. 6 | 'The secret will not reach the Enemy from us,' said Gildor. 7 | 'The Enemy?' said Frodo. 'Then you know why I am leaving the Shire?' 8 | 'I do not know for what reason the Enemy is pursuing you,' answered 9 | Gildor; 'but I perceive that he is - strange indeed though that seems to me. 10 | And I warn you that peril is now both before you and behind you, and upon 11 | either side.' 12 | 'You mean the Riders? I feared that they were servants of the Enemy. 13 | What are the Black Riders?' 14 | 'Has Gandalf told you nothing?' 15 | 'Nothing about such creatures.' 16 | 'Then I think it is not for me to say more - lest terror should keep 17 | you from your journey. For it seems to me that you have set out only just in 18 | time, if indeed you are in time. You must now make haste, and neither stay 19 | nor turn back; for the Shire is no longer any protection to you.' 20 | 'I cannot imagine what information could be more terrifying than your 21 | hints and warnings,' exclaimed Frodo. 'I knew that danger lay ahead, of 22 | course; but I did not expect to meet it in our own Shire. Can't a hobbit 23 | walk from the Water to the River in peace?' 24 | 'But it is not your own Shire,' said Gildor. 'Others dwelt here before 25 | hobbits were; and others will dwell here again when hobbits are no more. The 26 | wide world is all about you: you can fence yourselves in, but you cannot for 27 | ever fence it out.' 28 | 'I know - and yet it has always seemed so safe and familiar. What can I 29 | do now? My plan was to leave the Shire secretly, and make my way to 30 | Rivendell; but now my footsteps are dogged, before ever I get to Buckland.' 31 | 'I think you should still follow that plan,' said Gildor. 'I do not 32 | think the Road will prove too hard for your courage. But if you desire 33 | clearer counsel, you should ask Gandalf. I do not know the reason for your 34 | flight, and therefore I do not know by what means your pursuers will assail 35 | you. These things Gandalf must know. I suppose that you will see him before 36 | you leave the Shire?' 37 | 'I hope so. But that is another thing that makes me anxious. I have 38 | been expecting Gandalf for many days. He was to have come to Hobbiton at 39 | the 40 | latest two nights ago; but he has never appeared. Now I am wondering what 41 | can have happened. Should I wait for him?' 42 | Gildor was silent for a moment. 'I do not like this news,' he said at 43 | last. 'That Gandalf should be late, does not bode well. But it is said: Do 44 | not meddle in the affairs of Wizards, for they are subtle and quick to 45 | anger. The choice is yours: to go or wait.' 46 | 'And it is also said,' answered Frodo: 'Go not to the Elves for 47 | counsel, for they will say both no and yes.' 48 | 'Is it indeed?' laughed Gildor. 'Elves seldom give unguarded advice, 49 | for advice is a dangerous gift, even from the wise to the wise, and all 50 | courses may run ill. But what would you? You have not told me all concerning 51 | yourself; and how then shall I choose better than you? But if you demand 52 | advice, I will for friendship's sake give it. I think you should now go at 53 | once, without delay; and if Gandalf does not come before you set out, then I 54 | also advise this: do not go alone. Take such friends as are trusty and 55 | willing. Now you should be grateful, for I do not give this counsel gladly. 56 | The Elves have their own labours and their own sorrows, and they are little 57 | concerned with the ways of hobbits, or of any other creatures upon earth. 58 | Our paths cross theirs seldom, by chance or purpose. In this meeting there 59 | may be more than chance; but the purpose is not clear to me, and I fear to 60 | say too much.' 61 | 'I am deeply grateful,' said Frodo; 'but I wish you would tell me 62 | plainly what the Black Riders are. If I take your advice I may not see 63 | Gandalf for a long while, and I ought to know what is the danger that 64 | pursues me.' 65 | 'Is it not enough to know that they are servants of the Enemy?' 66 | answered Gildor. 'Flee them! Speak no words to them! They are deadly. Ask no 67 | more of me! But my heart forbodes that, ere all is ended, you, Frodo son of 68 | Drogo, will know more of these fell things than Gildor Inglorion. May 69 | Elbereth protect you!' 70 | 'But where shall I find courage?' asked Frodo. 'That is what I chiefly 71 | need.' 72 | 'Courage is found in unlikely places,' said Gildor. 'Be of good hope! 73 | Sleep now! In the morning we shall have gone; but we will send our messages 74 | through the lands. The Wandering Companies shall know of your journey, 75 | and 76 | those that have power for good shall be on the watch. I name you Elf-friend; 77 | and may the stars shine upon the end of your road! Seldom have we had such 78 | delight in strangers, and it is fair to hear words of the Ancient Speech 79 | from the lips of other wanderers in the world.' 80 | Frodo felt sleep coming upon him, even as Gildor finished speaking. 'I 81 | will sleep now,' he said; and the Elf led him to a bower beside Pippin, and 82 | he threw himself upon a bed and fell at once into a dreamless slumber. 83 | -------------------------------------------------------------------------------- /domains/lotr/data/rawtext/520.txt: -------------------------------------------------------------------------------- 1 | it won't be dangerous any more. There is a real king now and he will soon 2 | put the roads in order.' 3 | 'Thank you, my dear fellow!' said Bilbo. 'That really is a very great 4 | relief to my mind.' And with that he fell fast asleep again. 5 | The next day Gandalf and the hobbits took leave of Bilbo in his room, 6 | for it was cold out of doors; and then they said farewell to Elrond and all 7 | his household. 8 | As Frodo stood upon the threshold, Elrond wished him a fair journey, 9 | and blessed him, and he said: 10 | 'I think, Frodo, that maybe you will not need to come back, unless you 11 | come very soon. For about this time of the year, when the leaves are gold 12 | before they fall, look for Bilbo in the woods of the Shire. I shall be with 13 | him.' 14 | These words no one else heard, and Frodo kept them to himself. 15 | Chapter 7. Homeward Bound 16 | At last the hobbits had their faces turned towards home. They were 17 | eager now to see the Shire again; but at first they rode only slowly, for 18 | Frodo had been ill at ease. When they came to the Ford of Bruinen, he had 19 | halted, and seemed loth to ride into the stream; and they noted that for a 20 | while his eyes appeared not to see them or things about him. All that day he 21 | was silent. It was the sixth of October. 22 | 'Are you in pain, Frodo?' said Gandalf quietly as he rode by Frodo's 23 | side. 24 | 'Well, yes I am,' said Frodo. 'It is my shoulder. The wound aches, and 25 | the memory of darkness is heavy on me. It was a year ago today.' 26 | 'Alas! there are some wounds that cannot be wholly cured,' said 27 | Gandalf. 28 | 'I fear it may be so with mine,' said Frodo. 'There is no real going 29 | back. Though I may come to the Shire, it will not seem the same; for I shall 30 | not be the same. I am wounded with knife, sting, and tooth, and a long 31 | burden. Where shall I find rest?' 32 | Gandalf did not answer. 33 | By the end of the next day the pain and unease had passed, and Frodo 34 | was merry again, as merry as if he did not remember the blackness of the day 35 | before. After that the journey went well, and the days went quickly by; for 36 | they rode at leisure, and often they lingered in the fair woodlands where 37 | the leaves were red and yellow in the autumn sun. At length they came to 38 | Weathertop; and it was then drawing towards evening and the shadow of the 39 | hill lay dark on the road. Then Frodo begged them to hasten, and he would 40 | not look towards the hill, but rode through its shadow with head bowed and 41 | cloak drawn close about him. That night the weather changed, and a wind came 42 | from the West laden with rain, and it blew loud and chill, and the yellow 43 | leaves whirled like birds in the air. When they came to the Chetwood already 44 | the boughs were almost bare, and a great curtain of rain veiled Bree Hill 45 | from their sight. 46 | So it was that near the end of a wild and wet evening in the last days 47 | of October the five travellers rode up the climbing road and came to the 48 | South-gate of Bree. It was locked fast; and the rain blew in their faces, 49 | and in the darkening sky low clouds went hurrying by, and their hearts sank 50 | a little, for they had expected more welcome. 51 | When they had called many times, at last the Gate-keeper came out, and 52 | they saw that he carried a great cudgel. He looked at them with fear and 53 | suspicion; but when he saw that Gandalf was there, and that his companions 54 | were hobbits, in spite of their strange gear, then he brightened and wished 55 | them welcome. 56 | 'Come in!' he said, unlocking the gate. 'We won't stay for news out 57 | here in the cold and the wet, a ruffianly evening. But old Barley will no 58 | doubt give you a welcome at The Pony , and there you'll hear all there is to 59 | hear.' 60 | 'And there you'll hear later all that we say, and more,' laughed 61 | Gandalf. 'How is Harry?' 62 | The Gate-keeper scowled. 'Gone,' he said. 'But you'd best ask Barliman. 63 | Good evening!' 64 | 'Good evening to you!' they said, and passed through; and then they 65 | noticed that behind the hedge at the road-side a long low hut had been 66 | built, and a number of men had come out and were staring at them over the 67 | fence. When they came to Bill Ferny's house they saw that the hedge there 68 | was tattered and unkempt, and the windows were all boarded up. 69 | 'Do you think you killed him with that apple, Sam?' said Pippin. 70 | 'I'm not so hopeful, Mr. Pippin,' said Sam. 'But I'd like to know what 71 | became of that poor pony. He's been on my mind many a time and the wolves 72 | howling and all.' 73 | At last they came to The Prancing Pony , and that at least looked 74 | outwardly unchanged; and there were lights behind the red curtains in the 75 | lower windows. They rang the bell, and Nob came to the door, and opened it a 76 | crack and peeped through; and when he saw them standing under the lamp he 77 | gave a cry of surprise. 78 | 'Mr. Butterbur! Master!' he shouted. 'They've come back!' 79 | 'Oh have they? I'll learn them,' came Butterbur's voice, and out he 80 | came with a rush, and he had a club in his hand. But when he saw who they 81 | were he stopped short, and the black scowl on his face changed to wonder and 82 | delight. 83 | 'Nob, you woolly-pated ninny!' he cried. 'Can't you give old friends 84 | their names? You shouldn't go scaring me like that, with times as they are. 85 | --------------------------------------------------------------------------------