Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

making the DC Municipal Regulations Accessible

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 css
Octocat-spinner-32 generate_index
Octocat-spinner-32 js
Octocat-spinner-32 scrape
Octocat-spinner-32 README.md
Octocat-spinner-32 index.html
Octocat-spinner-32 package.json
Octocat-spinner-32 textify.py
Octocat-spinner-32 titles.js
README.md

The DC Municipal Regulations

The DC Municipal Regulations. This is also an experiment in open data design. See relevant post on Indexing and Searching Big Static Data

Most open data sites run as traditional websites; they have a content management function (a UI for editing content), a 'search engine', dynamic indexes, and more. They cost quite a bit of money to maintain, and often don't perform very well.

This is a different approach.

invert.js generates an inverted index of documents so that searches can run entirely in Javascript. And since this search index can be quite large, it allows it to be segmented.

titles.js generates a titles document, and index.html is a lightweight index.

Future bits will generate redirects to provide alternative url schemes via generating redirect pages.

The objective is to allow a large dataset, like the DCMR (~20k documents, ~68MB of plain text), to be quickly and easily browsed on a website that's powered by a simple, cheap host like Amazon S3. A government or individual could then pre-pay for years of service.

This should also permit incredibly easy clonability; federating the data store will be as simple as downloading a copy.

Installation

mkdir docs text indexes

Install node.js module dependencies:

npm install

Scrape the datasource

node/scrape/scrape.js

Generate a json document from the titles generated in the docs directory

node titles.json

Convert the documents into plain text Requires python plugins catdoc and sh installed which you can install via pip

python textify.py

Lastly, generate an index by running

cd generate_index
node invert.js
node trie.js
Something went wrong with that request. Please try again.