You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucy.apache.org by nw...@apache.org on 2015/08/06 20:37:47 UTC

[1/6] lucy git commit: C code examples for FastUpdates

Repository: lucy
Updated Branches:
  refs/heads/master 7c09f4df5 -> 45eac391a


C code examples for FastUpdates


Project: http://git-wip-us.apache.org/repos/asf/lucy/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/ffeebb89
Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/ffeebb89
Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/ffeebb89

Branch: refs/heads/master
Commit: ffeebb89a5eced49224d9c4f62f65ad0195b9d5e
Parents: de03f0f
Author: Nick Wellnhofer <we...@aevum.de>
Authored: Sun Jul 26 03:05:49 2015 +0200
Committer: Nick Wellnhofer <we...@aevum.de>
Committed: Thu Aug 6 19:41:50 2015 +0200

----------------------------------------------------------------------
 core/Lucy/Docs/Cookbook/FastUpdates.md | 145 +++++++++++++++++++++++++---
 core/Lucy/Index/BackgroundMerger.cfh   |   8 +-
 2 files changed, 134 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy/blob/ffeebb89/core/Lucy/Docs/Cookbook/FastUpdates.md
----------------------------------------------------------------------
diff --git a/core/Lucy/Docs/Cookbook/FastUpdates.md b/core/Lucy/Docs/Cookbook/FastUpdates.md
index 511310a..03f152c 100644
--- a/core/Lucy/Docs/Cookbook/FastUpdates.md
+++ b/core/Lucy/Docs/Cookbook/FastUpdates.md
@@ -28,11 +28,37 @@ rewritten.
 The simplest way to force fast index updates is to avoid rewriting anything.
 
 Indexer relies upon [](cfish:lucy.IndexManager)'s
-recycle() method to tell it which segments should be consolidated.  If we
-subclass IndexManager and override recycle() so that it always returns an
-empty array, we get consistently quick performance:
+[](cfish:lucy.IndexManager.Recycle) method to tell it which segments should
+be consolidated.  If we subclass IndexManager and override the method so that
+it always returns an empty array, we get consistently quick performance:
+
+``` c
+Vector*
+NoMergeManager_Recycle_IMP(IndexManager *self, PolyReader *reader,
+                           DeletionsWriter *del_writer, int64_t cutoff,
+                           bool optimize) {
+    return Vec_new(0);
+}
+
+void
+do_index(Obj *index) {
+    CFCClass *klass = Class_singleton("NoMergeManager", INDEXMANAGER);
+    Class_Override(klass, (cfish_method_t)NoMergeManager_Recycle_IMP,
+                   LUCY_IndexManager_Recycle_OFFSET);
+
+    IndexManager *manager = (IndexManager*)Class_Make_Obj(klass);
+    IxManager_init(manager, NULL, NULL);
+
+    Indexer *indexer = Indexer_new(NULL, index, manager, 0);
+    ...
+    Indexer_Commit(indexer);
 
-~~~ perl
+    DECREF(indexer);
+    DECREF(manager);
+}
+```
+
+``` perl
 package NoMergeManager;
 use base qw( Lucy::Index::IndexManager );
 sub recycle { [] }
@@ -44,20 +70,30 @@ my $indexer = Lucy::Index::Indexer->new(
 );
 ...
 $indexer->commit;
-~~~
+```
 
 However, we can't procrastinate forever.  Eventually, we'll have to run an
 ordinary, uncontrolled indexing session, potentially triggering a large
 rewrite of lots of small and/or degraded segments:
 
-~~~ perl
+``` c
+void
+do_index(Obj *index) {
+    Indexer *indexer = Indexer_new(NULL, index, NULL /* manager */, 0);
+    ...
+    Indexer_Commit(indexer);
+    DECREF(indexer);
+}
+```
+
+``` perl
 my $indexer = Lucy::Index::Indexer->new( 
     index => '/path/to/index', 
     # manager => NoMergeManager->new,
 );
 ...
 $indexer->commit;
-~~~
+```
 
 ## Acceptable worst-case update time, slower degradation
 
@@ -69,7 +105,31 @@ Setting a ceiling on the number of documents in the segments to be recycled
 allows us to avoid a mass proliferation of tiny, single-document segments,
 while still offering decent worst-case update speed:
 
-~~~ perl
+``` c
+Vector*
+LightMergeManager_Recycle_IMP(IndexManager *self, PolyReader *reader,
+                              DeletionsWriter *del_writer, int64_t cutoff,
+                              bool optimize) {
+    IndexManager_Recycle_t super_recycle
+        = SUPER_METHOD_PTR(IndexManager, LUCY_IndexManager_Recycle);
+    Vector *seg_readers = super_recycle(self, reader, del_writer, cutoff,
+                                        optimize);
+    Vector *small_segments = Vec_new(0);
+
+    for (size_t i = 0, max = Vec_Get_Size(seg_readers); i < max; i++) {
+        SegReader *seg_reader = (SegReader*)Vec_Fetch(seg_readers, i);
+
+        if (SegReader_Doc_Max(seg_reader) < 10) {
+            Vec_Push(small_segments, INCREF(seg_reader));
+        }
+    }
+
+    DECREF(seg_readers);
+    return small_segments;
+}
+```
+
+``` perl
 package LightMergeManager;
 use base qw( Lucy::Index::IndexManager );
 
@@ -79,7 +139,7 @@ sub recycle {
     @$seg_readers = grep { $_->doc_max < 10 } @$seg_readers;
     return $seg_readers;
 }
-~~~
+```
 
 However, we still have to consolidate every once in a while, and while that
 happens content updates will be locked out.
@@ -88,13 +148,67 @@ happens content updates will be locked out.
 
 If it's not acceptable to lock out updates while the index consolidation
 process runs, the alternative is to move the consolidation process out of
-band, using Lucy::Index::BackgroundMerger.  
+band, using [](cfish:lucy.BackgroundMerger).
 
 It's never safe to have more than one Indexer attempting to modify the content
 of an index at the same time, but a BackgroundMerger and an Indexer can
 operate simultaneously:
 
-~~~ perl
+``` c
+typedef struct {
+    Obj *index;
+    Doc *doc;
+} Context;
+
+static void
+S_index_doc(void *arg) {
+    Context *ctx = (Context*)arg;
+
+    CFCClass *klass = Class_singleton("LightMergeManager", INDEXMANAGER);
+    Class_Override(klass, (cfish_method_t)LightMergeManager_Recycle_IMP,
+                   LUCY_IndexManager_Recycle_OFFSET);
+
+    IndexManager *manager = (IndexManager*)Class_Make_Obj(klass);
+    IxManager_init(manager, NULL, NULL);
+
+    Indexer *indexer = Indexer_new(NULL, ctx->index, manager, 0);
+    Indexer_Add_Doc(indexer, ctx->doc, 1.0);
+    Indexer_Commit(indexer);
+
+    DECREF(indexer);
+    DECREF(manager);
+}
+
+void indexing_process(Obj *index, Doc *doc) {
+    Context ctx;
+    ctx.index = index;
+    ctx.doc = doc;
+
+    for (int i = 0; i < max_retries; i++) {
+        Err *err = Err_trap(S_index_doc, &ctx);
+        if (!err) { break; }
+        if (!Err_is_a(err, LOCKERR)) {
+            RETHROW(err);
+        }
+        WARN("Couldn't get lock (%d retries)", i);
+        DECREF(err);
+    }
+}
+
+void
+background_merge_process(Obj *index) {
+    IndexManager *manager = IxManager_new(NULL, NULL);
+    IxManager_Set_Write_Lock_Timeout(manager, 60000);
+
+    BackgroundMerger bg_merger = BGMerger_new(index, manager);
+    BGMerger_Commit(bg_merger);
+
+    DECREF(bg_merger);
+    DECREF(manager);
+}
+```
+
+``` perl
 # Indexing process.
 use Scalar::Util qw( blessed );
 my $retries = 0;
@@ -126,15 +240,16 @@ my $bg_merger = Lucy::Index::BackgroundMerger->new(
     manager => $manager,
 );
 $bg_merger->commit;
-~~~
+```
 
 The exception handling code becomes useful once you have more than one index
 modification process happening simultaneously.  By default, Indexer tries
 several times to acquire a write lock over the span of one second, then holds
-it until commit() completes.  BackgroundMerger handles most of its work
+it until [](cfish:lucy.Indexer.Commit) completes.  BackgroundMerger handles
+most of its work
 without the write lock, but it does need it briefly once at the beginning and
 once again near the end.  Under normal loads, the internal retry logic will
 resolve conflicts, but if it's not acceptable to miss an insert, you probably
-want to catch LockErr exceptions thrown by Indexer.  In contrast, a LockErr
-from BackgroundMerger probably just needs to be logged.
+want to catch [](cfish:lucy.LockErr) exceptions thrown by Indexer.  In
+contrast, a LockErr from BackgroundMerger probably just needs to be logged.
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/ffeebb89/core/Lucy/Index/BackgroundMerger.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/BackgroundMerger.cfh b/core/Lucy/Index/BackgroundMerger.cfh
index a19886b..8d60c8b 100644
--- a/core/Lucy/Index/BackgroundMerger.cfh
+++ b/core/Lucy/Index/BackgroundMerger.cfh
@@ -20,11 +20,11 @@ parcel Lucy;
  *
  * Adding documents to an index is usually fast, but every once in a while the
  * index must be compacted and an update takes substantially longer to
- * complete.  See [FastUpdates](Lucy::Docs::Cookbook::FastUpdates) for how to
- * use this class to control worst-case index update performance.
+ * complete.  See [](cfish:FastUpdates) for how to use this class to control
+ * worst-case index update performance.
  *
- * As with [](cfish:Indexer), see [FileLocking](Lucy::Docs::FileLocking)
- * if your index is on a shared volume.
+ * As with [](cfish:Indexer), see [](cfish:FileLocking) if your index is on a
+ * shared volume.
  */
 public class Lucy::Index::BackgroundMerger nickname BGMerger
     inherits Clownfish::Obj {


[2/6] lucy git commit: Make Inversion public

Posted by nw...@apache.org.
Make Inversion public


Project: http://git-wip-us.apache.org/repos/asf/lucy/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/de03f0fa
Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/de03f0fa
Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/de03f0fa

Branch: refs/heads/master
Commit: de03f0fa2810fe77f34ca6b28cc502dd97a0d66f
Parents: 7c09f4d
Author: Nick Wellnhofer <we...@aevum.de>
Authored: Mon Jul 27 02:46:06 2015 +0200
Committer: Nick Wellnhofer <we...@aevum.de>
Committed: Thu Aug 6 19:41:50 2015 +0200

----------------------------------------------------------------------
 core/Lucy/Analysis/Inversion.cfh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy/blob/de03f0fa/core/Lucy/Analysis/Inversion.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Analysis/Inversion.cfh b/core/Lucy/Analysis/Inversion.cfh
index d722181..63d84fe 100644
--- a/core/Lucy/Analysis/Inversion.cfh
+++ b/core/Lucy/Analysis/Inversion.cfh
@@ -22,7 +22,7 @@ parcel Lucy;
  * An Inversion is a collection of Token objects which you can add to, then
  * iterate over.
  */
-class Lucy::Analysis::Inversion inherits Clownfish::Obj {
+public class Lucy::Analysis::Inversion inherits Clownfish::Obj {
 
     Token    **tokens;
     uint32_t   size;


[4/6] lucy git commit: C code examples for tutorial

Posted by nw...@apache.org.
http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/common/sample/us_constitution/index.html
----------------------------------------------------------------------
diff --git a/common/sample/us_constitution/index.html b/common/sample/us_constitution/index.html
new file mode 100644
index 0000000..16948b0
--- /dev/null
+++ b/common/sample/us_constitution/index.html
@@ -0,0 +1,114 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+
+<html>
+
+  <head>
+    <meta http-equiv="content-type" content="text/html;charset=UTF-8">
+    <link rel="stylesheet" type="text/css" href="uscon.css">
+    <title>US Constitution</title>
+    <!--
+      Licensed to the Apache Software Foundation (ASF) under one or more
+      contributor license agreements.  See the NOTICE file distributed with
+      this work for additional information regarding copyright ownership.
+      The ASF licenses this file to You under the Apache License, Version 2.0
+      (the "License"); you may not use this file except in compliance with
+      the License.  You may obtain a copy of the License at
+      
+        http://www.apache.org/licenses/LICENSE-2.0
+      
+      Unless required by applicable law or agreed to in writing, software
+      distributed under the License is distributed on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+      See the License for the specific language governing permissions and
+      limitations under the License.
+    -->
+  </head>
+
+  <body>
+    <div id="navigation">
+       US Constitution
+    </div><!--navigation-->
+
+    <div id="bodytext">
+    <ul>
+      <li><a href="preamble.txt">Preamble</a></li>
+
+      <li><a name="articles"></a>Article I</li>
+        <ul>
+          <li><a href="art1sec1.txt">Article I Section 1</a></li>
+          <li><a href="art1sec2.txt">Article I Section 2</a></li>
+          <li><a href="art1sec3.txt">Article I Section 3</a></li>
+          <li><a href="art1sec4.txt">Article I Section 4</a></li>
+          <li><a href="art1sec5.txt">Article I Section 5</a></li>
+          <li><a href="art1sec6.txt">Article I Section 6</a></li>
+          <li><a href="art1sec7.txt">Article I Section 7</a></li>
+          <li><a href="art1sec8.txt">Article I Section 8</a></li>
+          <li><a href="art1sec9.txt">Article I Section 9</a></li>
+          <li><a href="art1sec10.txt">Article I Section 10</a></li>
+        </ul>
+    
+      <li>Article II</li>
+        <ul>
+          <li><a href="art2sec1.txt">Article II Section 1</a></li>
+          <li><a href="art2sec2.txt">Article II Section 2</a></li>
+          <li><a href="art2sec3.txt">Article II Section 3</a></li>
+          <li><a href="art2sec4.txt">Article II Section 4</a></li>
+        </ul>
+        
+      <li>Article III</li>
+        <ul>
+          <li><a href="art3sec1.txt">Article III Section 1</a></li>
+          <li><a href="art3sec2.txt">Article III Section 2</a></li>
+          <li><a href="art3sec3.txt">Article III Section 3</a></li>
+        </ul>
+        
+      <li>Article IV</li>
+        <ul>
+          <li><a href="art4sec1.txt">Article IV Section 1</a></li>
+          <li><a href="art4sec2.txt">Article IV Section 2</a></li>
+          <li><a href="art4sec3.txt">Article IV Section 3</a></li>
+          <li><a href="art4sec4.txt">Article IV Section 4</a></li>
+        </ul>
+    
+      <li><a href="art5.txt">Article V</a></li>
+    
+      <li><a href="art6.txt">Article VI</a></li>
+    
+      <li><a href="art7.txt">Article VII</a></li>
+    
+      <li><a name="amendments"></a>Amendments</li>
+        <ul>
+          <li><a href="amend1.txt">Amendment 1</a></li>
+          <li><a href="amend2.txt">Amendment 2</a></li>
+          <li><a href="amend3.txt">Amendment 3</a></li>
+          <li><a href="amend4.txt">Amendment 4</a></li>
+          <li><a href="amend5.txt">Amendment 5</a></li>
+          <li><a href="amend6.txt">Amendment 6</a></li>
+          <li><a href="amend7.txt">Amendment 7</a></li>
+          <li><a href="amend8.txt">Amendment 8</a></li>
+          <li><a href="amend9.txt">Amendment 9</a></li>
+          <li><a href="amend10.txt">Amendment 10</a></li>
+          <li><a href="amend11.txt">Amendment 11</a></li>
+          <li><a href="amend12.txt">Amendment 12</a></li>
+          <li><a href="amend13.txt">Amendment 13</a></li>
+          <li><a href="amend14.txt">Amendment 14</a></li>
+          <li><a href="amend15.txt">Amendment 15</a></li>
+          <li><a href="amend16.txt">Amendment 16</a></li>
+          <li><a href="amend17.txt">Amendment 17</a></li>
+          <li><a href="amend18.txt">Amendment 18</a></li>
+          <li><a href="amend19.txt">Amendment 19</a></li>
+          <li><a href="amend20.txt">Amendment 20</a></li>
+          <li><a href="amend21.txt">Amendment 21</a></li>
+          <li><a href="amend22.txt">Amendment 22</a></li>
+          <li><a href="amend23.txt">Amendment 23</a></li>
+          <li><a href="amend24.txt">Amendment 24</a></li>
+          <li><a href="amend25.txt">Amendment 25</a></li>
+          <li><a href="amend26.txt">Amendment 26</a></li>
+          <li><a href="amend27.txt">Amendment 27</a></li>
+        </ul>
+    </ul>
+  </div><!--bodytext-->
+  </body>
+
+</html>
+

http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/common/sample/us_constitution/preamble.txt
----------------------------------------------------------------------
diff --git a/common/sample/us_constitution/preamble.txt b/common/sample/us_constitution/preamble.txt
new file mode 100644
index 0000000..ee1bffe
--- /dev/null
+++ b/common/sample/us_constitution/preamble.txt
@@ -0,0 +1,8 @@
+Preamble
+
+We the People of the United States, in Order to form a more perfect Union,
+establish Justice, insure domestic Tranquility, provide for the common
+defence, promote the general Welfare, and secure the Blessings of Liberty to
+ourselves and our Posterity, do ordain and establish this Constitution for
+the United States of America. 
+

http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/common/sample/us_constitution/uscon.css
----------------------------------------------------------------------
diff --git a/common/sample/us_constitution/uscon.css b/common/sample/us_constitution/uscon.css
new file mode 100644
index 0000000..c674edd
--- /dev/null
+++ b/common/sample/us_constitution/uscon.css
@@ -0,0 +1,45 @@
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+body,table,textarea {
+    font-family: Arial, Helvetica, sans-serif;
+}
+
+body {
+    font-size: 90%; 
+    background: #fff;
+    margin: 0 0 0 0;
+}
+
+div#navigation {
+    background: #ddfff6;
+    padding: 10px;
+    border-bottom: 1px solid #555;
+}
+
+div#bodytext {
+    margin: 10px 10px 10px 10px;
+}
+
+form#usconSearch {
+    display: inline;
+    margin-bottom: 0px;
+}
+
+span.excerptURL {
+    color: green;
+}
+

http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/core/Lucy/Docs/Tutorial.md
----------------------------------------------------------------------
diff --git a/core/Lucy/Docs/Tutorial.md b/core/Lucy/Docs/Tutorial.md
index 57c66b2..7fa5332 100644
--- a/core/Lucy/Docs/Tutorial.md
+++ b/core/Lucy/Docs/Tutorial.md
@@ -33,11 +33,19 @@ of the United States constitution -- can be found in the `sample` directory
 at the root of the Lucy distribution, along with finished indexing and search
 apps.
 
-~~~ perl
+``` c
+sample/indexer_simple.c  # simple indexing executable
+sample/search_simple.c   # simple search executable
+sample/indexer.c         # indexing executable
+sample/search.c          # search executable
+sample/us_constitution   # corpus
+```
+
+``` perl
 sample/indexer.pl        # indexing app
 sample/search.cgi        # search app
 sample/us_constitution   # corpus
-~~~
+```
 
 ## Conventions
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/core/Lucy/Docs/Tutorial/AnalysisTutorial.md
----------------------------------------------------------------------
diff --git a/core/Lucy/Docs/Tutorial/AnalysisTutorial.md b/core/Lucy/Docs/Tutorial/AnalysisTutorial.md
index a55dd09..6abcae7 100644
--- a/core/Lucy/Docs/Tutorial/AnalysisTutorial.md
+++ b/core/Lucy/Docs/Tutorial/AnalysisTutorial.md
@@ -1,13 +1,19 @@
 # How to choose and use Analyzers.
 
-Try swapping out the EasyAnalyzer in our Schema for a StandardTokenizer:
+Try swapping out the EasyAnalyzer in our Schema for a
+[](lucy.StandardTokenizer):
 
-~~~ perl
+``` c
+    StandardTokenizer *tokenizer = StandardTokenizer_new();
+    FullTextType *type = FullTextType_new((Analyzer*)tokenizer);
+```
+
+``` perl
 my $tokenizer = Lucy::Analysis::StandardTokenizer->new;
 my $type = Lucy::Plan::FullTextType->new(
     analyzer => $tokenizer,
 );
-~~~
+```
 
 Search for `senate`, `Senate`, and `Senator` before and after making the
 change and re-indexing.
@@ -18,45 +24,68 @@ under StandardTokenizer, searches are case-sensitive, and the result sets for
 
 ## EasyAnalyzer
 
-What's happening is that EasyAnalyzer is performing more aggressive processing
-than StandardTokenizer.  In addition to tokenizing, it's also converting all
-text to lower case so that searches are case-insensitive, and using a
-"stemming" algorithm to reduce related words to a common stem (`senat`, in
-this case).
+What's happening is that [](lucy.EasyAnalyzer) is performing more aggressive
+processing than StandardTokenizer.  In addition to tokenizing, it's also
+converting all text to lower case so that searches are case-insensitive, and
+using a "stemming" algorithm to reduce related words to a common stem (`senat`,
+in this case).
 
 EasyAnalyzer is actually multiple Analyzers wrapped up in a single package.
 In this case, it's three-in-one, since specifying a EasyAnalyzer with
-`language => 'en'` is equivalent to this snippet:
+`language => 'en'` is equivalent to this snippet creating a
+[](lucy.PolyAnalyzer):
+
+``` c
+    Vector *analyzers = Vec_new(3);
+    Vec_Push(analyzers, (Analyzer*)StandardTokenizer_new());
+    Vec_Push(analyzers, (Analyzer*)Normalizer_new(NULL, true, false));
+    Vec_Push(analyzers, (Analyzer*)SnowStemmer_new(language));
+
+    PolyAnalyzer *analyzer = PolyAnalyzer_new(NULL, analyzers);
+    DECREC(analyzers);
+```
 
-~~~ perl
+``` perl
 my $tokenizer    = Lucy::Analysis::StandardTokenizer->new;
 my $normalizer   = Lucy::Analysis::Normalizer->new;
 my $stemmer      = Lucy::Analysis::SnowballStemmer->new( language => 'en' );
 my $polyanalyzer = Lucy::Analysis::PolyAnalyzer->new(
     analyzers => [ $tokenizer, $normalizer, $stemmer ],
 );
-~~~
+```
 
 You can add or subtract Analyzers from there if you like.  Try adding a fourth
 Analyzer, a SnowballStopFilter for suppressing "stopwords" like "the", "if",
 and "maybe".
 
-~~~ perl
+``` c
+    Vec_Push(analyzers, (Analyzer*)StandardTokenizer_new());
+    Vec_Push(analyzers, (Analyzer*)Normalizer_new(NULL, true, false));
+    Vec_Push(analyzers, (Analyzer*)SnowStemmer_new(language));
+    Vec_Push(analyzers, (Analyzer*)SnowStop_new(language, NULL));
+```
+
+``` perl
 my $stopfilter = Lucy::Analysis::SnowballStopFilter->new( 
     language => 'en',
 );
 my $polyanalyzer = Lucy::Analysis::PolyAnalyzer->new(
     analyzers => [ $tokenizer, $normalizer, $stopfilter, $stemmer ],
 );
-~~~
+```
 
 Also, try removing the SnowballStemmer.
 
-~~~ perl
+``` c
+    Vec_Push(analyzers, (Analyzer*)StandardTokenizer_new());
+    Vec_Push(analyzers, (Analyzer*)Normalizer_new(NULL, true, false));
+```
+
+``` perl
 my $polyanalyzer = Lucy::Analysis::PolyAnalyzer->new(
     analyzers => [ $tokenizer, $normalizer ],
 );
-~~~
+```
 
 The original choice of a stock English EasyAnalyzer probably still yields the
 best results for this document collection, but you get the idea: sometimes you
@@ -72,10 +101,18 @@ you may not want to conflate results for "Humphrey" and "Humphries").
 
 To specify that there should be no analysis performed at all, use StringType:
 
-~~~ perl
+``` c
+    String     *name = Str_newf("category");
+    StringType *type = StringType_new();
+    Schema_Spec_Field(schema, name, (FieldType*)type);
+    DECREF(type);
+    DECREF(name);
+```
+
+``` perl
 my $type = Lucy::Plan::StringType->new;
 $schema->spec_field( name => 'category', type => $type );
-~~~
+```
 
 ## Highlighting up next
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/core/Lucy/Docs/Tutorial/BeyondSimpleTutorial.md
----------------------------------------------------------------------
diff --git a/core/Lucy/Docs/Tutorial/BeyondSimpleTutorial.md b/core/Lucy/Docs/Tutorial/BeyondSimpleTutorial.md
index 00c8e71..8a33062 100644
--- a/core/Lucy/Docs/Tutorial/BeyondSimpleTutorial.md
+++ b/core/Lucy/Docs/Tutorial/BeyondSimpleTutorial.md
@@ -21,19 +21,78 @@ classes that it uses internally:
 
 After we load our modules...
 
-~~~ perl
+``` c
+#include <dirent.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#define CFISH_USE_SHORT_NAMES
+#define LUCY_USE_SHORT_NAMES
+#include "Clownfish/String.h"
+#include "Lucy/Analysis/EasyAnalyzer.h"
+#include "Lucy/Document/Doc.h"
+#include "Lucy/Index/Indexer.h"
+#include "Lucy/Plan/FullTextType.h"
+#include "Lucy/Plan/StringType.h"
+#include "Lucy/Plan/Schema.h"
+
+const char path_to_index[] = "/path/to/index";
+const char uscon_source[]  = "/usr/local/apache2/htdocs/us_constitution";
+```
+
+``` perl
 use Lucy::Plan::Schema;
 use Lucy::Plan::FullTextType;
 use Lucy::Analysis::EasyAnalyzer;
 use Lucy::Index::Indexer;
-~~~
+```
 
 ... the first item we're going need is a [](cfish:lucy.Schema).
 
 The primary job of a Schema is to specify what fields are available and how
 they're defined.  We'll start off with three fields: title, content and url.
 
-~~~ perl
+``` c
+static Schema*
+S_create_schema() {
+    // Create a new schema.
+    Schema *schema = Schema_new();
+
+    // Create an analyzer.
+    String       *language = Str_newf("en");
+    EasyAnalyzer *analyzer = EasyAnalyzer_new(language);
+
+    // Specify fields.
+
+    FullTextType *type = FullTextType_new((Analyzer*)analyzer);
+
+    {
+        String *field_str = Str_newf("title");
+        Schema_Spec_Field(schema, field_str, (FieldType*)type);
+        DECREF(field_str);
+    }
+
+    {
+        String *field_str = Str_newf("content");
+        Schema_Spec_Field(schema, field_str, (FieldType*)type);
+        DECREF(field_str);
+    }
+
+    {
+        String *field_str = Str_newf("url");
+        Schema_Spec_Field(schema, field_str, (FieldType*)type);
+        DECREF(field_str);
+    }
+
+    DECREF(type);
+    DECREF(analyzer);
+    DECREF(language);
+    return schema;
+}
+```
+
+``` perl
 # Create Schema.
 my $schema = Lucy::Plan::Schema->new;
 my $easyanalyzer = Lucy::Analysis::EasyAnalyzer->new(
@@ -45,21 +104,35 @@ my $type = Lucy::Plan::FullTextType->new(
 $schema->spec_field( name => 'title',   type => $type );
 $schema->spec_field( name => 'content', type => $type );
 $schema->spec_field( name => 'url',     type => $type );
-~~~
+```
 
-All of the fields are spec'd out using the "FullTextType" FieldType,
+All of the fields are spec'd out using the [](lucy.FullTextType) FieldType,
 indicating that they will be searchable as "full text" -- which means that
 they can be searched for individual words.  The "analyzer", which is unique to
 FullTextType fields, is what breaks up the text into searchable tokens.
 
-Next, we'll swap our Lucy::Simple object out for a Lucy::Index::Indexer.
+Next, we'll swap our Lucy::Simple object out for an [](lucy.Indexer).
 The substitution will be straightforward because Simple has merely been
 serving as a thin wrapper around an inner Indexer, and we'll just be peeling
 away the wrapper.
 
 First, replace the constructor:
 
-~~~ perl
+``` c
+int
+main() {
+    // Initialize the library.
+    lucy_bootstrap_parcel();
+
+    Schema *schema = S_create_schema();
+    String *folder = Str_newf("%s", path_to_index);
+
+    Indexer *indexer = Indexer_new(schema, (Obj*)folder, NULL,
+                                   Indexer_CREATE | Indexer_TRUNCATE);
+
+```
+
+``` perl
 # Create Indexer.
 my $indexer = Lucy::Index::Indexer->new(
     index    => $path_to_index,
@@ -67,25 +140,56 @@ my $indexer = Lucy::Index::Indexer->new(
     create   => 1,
     truncate => 1,
 );
-~~~
+```
+
+Next, have the `indexer` object [](cfish:lucy.Indexer.Add_Doc) where we
+were having the `lucy` object adding the document before:
+
+``` c
+    DIR *dir = opendir(uscon_source);
+    if (dir == NULL) {
+        perror(uscon_source);
+        return 1;
+    }
+
+    for (struct dirent *entry = readdir(dir);
+         entry;
+         entry = readdir(dir)) {
+
+        if (S_ends_with(entry->d_name, ".txt")) {
+            Doc *doc = S_parse_file(entry->d_name);
+            Indexer_Add_Doc(indexer, doc, 1.0);
+            DECREF(doc);
+        }
+    }
 
-Next, have the `$indexer` object `add_doc` where we were having the
-`$lucy` object `add_doc` before:
+    closedir(dir);
+```
 
-~~~ perl
+``` perl
 foreach my $filename (@filenames) {
     my $doc = parse_file($filename);
     $indexer->add_doc($doc);
 }
-~~~
+```
 
 There's only one extra step required: at the end of the app, you must call
 commit() explicitly to close the indexing session and commit your changes.
 (Lucy::Simple hides this detail, calling commit() implicitly when it needs to).
 
-~~~ perl
+``` c
+    Indexer_Commit(indexer);
+
+    DECREF(indexer);
+    DECREF(folder);
+    DECREF(schema);
+    return 0;
+}
+```
+
+``` perl
 $indexer->commit;
-~~~
+```
 
 ## Adaptations to search.cgi
 
@@ -94,7 +198,74 @@ thin wrapper -- this time around [](cfish:lucy.IndexSearcher) and
 [](cfish:lucy.Hits).  Swapping out Simple for these two classes is
 also straightforward:
 
-~~~ perl
+``` c
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#define CFISH_USE_SHORT_NAMES
+#define LUCY_USE_SHORT_NAMES
+#include "Clownfish/String.h"
+#include "Lucy/Document/HitDoc.h"
+#include "Lucy/Search/Hits.h"
+#include "Lucy/Search/IndexSearcher.h"
+
+const char path_to_index[] = "/path/to/index";
+
+int
+main(int argc, char *argv[]) {
+    // Initialize the library.
+    lucy_bootstrap_parcel();
+
+    if (argc < 2) {
+        printf("Usage: %s <querystring>\n", argv[0]);
+        return 0;
+    }
+
+    const char *query_c = argv[1];
+
+    printf("Searching for: %s\n\n", query_c);
+
+    String        *folder   = Str_newf("%s", path_to_index);
+    IndexSearcher *searcher = IxSearcher_new((Obj*)folder);
+
+    String *query_str = Str_newf("%s", query_c);
+    Hits *hits = IxSearcher_Hits(searcher, (Obj*)query_str, 0, 10, NULL);
+
+    String *title_str = Str_newf("title");
+    String *url_str   = Str_newf("url");
+    HitDoc *hit;
+    int i = 1;
+
+    // Loop over search results.
+    while (NULL != (hit = Hits_Next(hits))) {
+        String *title = (String*)HitDoc_Extract(hit, title_str);
+        char *title_c = Str_To_Utf8(title);
+
+        String *url = (String*)HitDoc_Extract(hit, url_str);
+        char *url_c = Str_To_Utf8(url);
+
+        printf("Result %d: %s (%s)\n", i, title_c, url_c);
+
+        free(url_c);
+        free(title_c);
+        DECREF(url);
+        DECREF(title);
+        DECREF(hit);
+        i++;
+    }
+
+    DECREF(url_str);
+    DECREF(title_str);
+    DECREF(hits);
+    DECREF(query_str);
+    DECREF(searcher);
+    DECREF(folder);
+    return 0;
+}
+```
+
+``` perl
 use Lucy::Search::IndexSearcher;
 
 my $searcher = Lucy::Search::IndexSearcher->new( 
@@ -112,14 +283,14 @@ my $hit_count = $hits->total_hits;  # get the hit count here
 while ( my $hit = $hits->next ) {
     ...
 }
-~~~
+```
 
 ## Hooray!
 
 Congratulations!  Your apps do the same thing as before... but now they'll be
 easier to customize.  
 
-In our next chapter, ()[cfish:FieldTypeTutorial), we'll explore
+In our next chapter, [](cfish:FieldTypeTutorial), we'll explore
 how to assign different behaviors to different fields.
 
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/core/Lucy/Docs/Tutorial/FieldTypeTutorial.md
----------------------------------------------------------------------
diff --git a/core/Lucy/Docs/Tutorial/FieldTypeTutorial.md b/core/Lucy/Docs/Tutorial/FieldTypeTutorial.md
index fe6885a..cd30dae 100644
--- a/core/Lucy/Docs/Tutorial/FieldTypeTutorial.md
+++ b/core/Lucy/Docs/Tutorial/FieldTypeTutorial.md
@@ -2,14 +2,37 @@
 
 The Schema we used in the last chapter specifies three fields: 
 
-~~~ perl
+``` c
+    FullTextType *type = FullTextType_new((Analyzer*)analyzer);
+
+    {
+        String *field_str = Str_newf("title");
+        Schema_Spec_Field(schema, field_str, (FieldType*)type);
+        DECREF(field_str);
+    }
+
+    {
+        String *field_str = Str_newf("content");
+        Schema_Spec_Field(schema, field_str, (FieldType*)type);
+        DECREF(field_str);
+    }
+
+    {
+        String *field_str = Str_newf("url");
+        Schema_Spec_Field(schema, field_str, (FieldType*)type);
+        DECREF(field_str);
+    }
+
+```
+
+``` perl
 my $type = Lucy::Plan::FullTextType->new(
-    analyzer => $polyanalyzer,
+    analyzer => $easyanalyzer,
 );
 $schema->spec_field( name => 'title',   type => $type );
 $schema->spec_field( name => 'content', type => $type );
 $schema->spec_field( name => 'url',     type => $type );
-~~~
+```
 
 Since they are all defined as "full text" fields, they are all searchable --
 including the `url` field, a dubious choice.  Some URLs contain meaningful
@@ -27,10 +50,21 @@ Instead of FullTextType, we'll use a
 Analyzer to break up text into individual fields.  Furthermore, we'll mark
 this StringType as unindexed, so that its content won't be searchable at all.
 
-~~~ perl
+``` c
+    {
+        String *field_str = Str_newf("url");
+        StringType *type = StringType_new();
+        StringType_Set_Indexed(type, false);
+        Schema_Spec_Field(schema, field_str, (FieldType*)type);
+        DECREF(type);
+        DECREF(field_str);
+    }
+```
+
+``` perl
 my $url_type = Lucy::Plan::StringType->new( indexed => 0 );
 $schema->spec_field( name => 'url', type => $url_type );
-~~~
+```
 
 To observe the change in behavior, try searching for `us_constitution` both
 before and after changing the Schema and re-indexing.
@@ -40,12 +74,17 @@ before and after changing the Schema and re-indexing.
 For a taste of other FieldType possibilities, try turning off `stored` for
 one or more fields.
 
-~~~ perl
+``` c
+    FullTextType *content_type = FullTextType_new((Analyzer*)analyzer);
+    FullTextType_Set_Stored(content_type, false);
+```
+
+``` perl
 my $content_type = Lucy::Plan::FullTextType->new(
-    analyzer => $polyanalyzer,
+    analyzer => $easyanalyzer,
     stored   => 0,
 );
-~~~
+```
 
 Turning off `stored` for either `title` or `url` mangles our results page,
 but since we're not displaying `content`, turning it off for `content` has

http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/core/Lucy/Docs/Tutorial/HighlighterTutorial.md
----------------------------------------------------------------------
diff --git a/core/Lucy/Docs/Tutorial/HighlighterTutorial.md b/core/Lucy/Docs/Tutorial/HighlighterTutorial.md
index 857ee01..9edc342 100644
--- a/core/Lucy/Docs/Tutorial/HighlighterTutorial.md
+++ b/core/Lucy/Docs/Tutorial/HighlighterTutorial.md
@@ -10,31 +10,88 @@ hits look promising, dramatically improving their search experience.
 time.  To save resources, highlighting is disabled by default and must be
 turned on for individual fields.
 
-~~~ perl
+``` c
+    {
+        String *field_str = Str_newf("content");
+        FullTextType *type = FullTextType_new((Analyzer*)analyzer);
+        FullTextType_Set_Highlightable(type, true);
+        Schema_Spec_Field(schema, field_str, (FieldType*)type);
+        DECREF(type);
+        DECREF(field_str);
+    }
+```
+
+``` perl
 my $highlightable = Lucy::Plan::FullTextType->new(
-    analyzer      => $polyanalyzer,
+    analyzer      => $easyanalyzer,
     highlightable => 1,
 );
 $schema->spec_field( name => 'content', type => $highlightable );
-~~~
+```
 
 ## Adaptations to search.cgi
 
 To add highlighting and excerpting to the search.cgi sample app, create a
 `$highlighter` object outside the hits iterating loop...
 
-~~~ perl
+``` c
+    String *content_str = Str_newf("content");
+    Highlighter *highlighter
+        = Highlighter_new((Searcher*)searcher, (Obj*)query,
+                          content_str, 200);
+```
+
+``` perl
 my $highlighter = Lucy::Highlight::Highlighter->new(
     searcher => $searcher,
     query    => $q,
     field    => 'content'
 );
-~~~
+```
 
 ... then modify the loop and the per-hit display to generate and include the
 excerpt.
 
-~~~ perl
+``` c
+    String *title_str = Str_newf("title");
+    String *url_str   = Str_newf("url");
+    HitDoc *hit;
+    i = 1;
+
+    // Loop over search results.
+    while (NULL != (hit = Hits_Next(hits))) {
+        String *title = (String*)HitDoc_Extract(hit, title_str);
+        char *title_c = Str_To_Utf8(title);
+
+        String *url = (String*)HitDoc_Extract(hit, url_str);
+        char *url_c = Str_To_Utf8(url);
+
+        String *excerpt = Highlighter_Create_Excerpt(highlighter, hit);
+        char *excerpt_c = Str_To_Utf8(excerpt);
+
+        printf("Result %d: %s (%s)\n%s\n\n", i, title_c, url_c, excerpt_c);
+
+        free(excerpt_c);
+        free(url_c);
+        free(title_c);
+        DECREF(excerpt);
+        DECREF(url);
+        DECREF(title);
+        DECREF(hit);
+        i++;
+    }
+
+    DECREF(url_str);
+    DECREF(title_str);
+    DECREF(hits);
+    DECREF(query_str);
+    DECREF(highlighter);
+    DECREF(content_str);
+    DECREF(searcher);
+    DECREF(folder);
+```
+
+``` perl
 # Create result list.
 my $report = '';
 while ( my $hit = $hits->next ) {
@@ -51,7 +108,7 @@ while ( my $hit = $hits->next ) {
         </p>
     |;
 }
-~~~
+```
 
 ## Next chapter: Query objects
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/core/Lucy/Docs/Tutorial/QueryObjectsTutorial.md
----------------------------------------------------------------------
diff --git a/core/Lucy/Docs/Tutorial/QueryObjectsTutorial.md b/core/Lucy/Docs/Tutorial/QueryObjectsTutorial.md
index 53d4cea..c2b6a96 100644
--- a/core/Lucy/Docs/Tutorial/QueryObjectsTutorial.md
+++ b/core/Lucy/Docs/Tutorial/QueryObjectsTutorial.md
@@ -19,16 +19,55 @@ Our new "category" field will be a StringType field rather than a FullTextType
 field, because we will only be looking for exact matches.  It needs to be
 indexed, but since we won't display its value, it doesn't need to be stored.
 
-~~~ perl
+``` c
+    {
+        String *field_str = Str_newf("category");
+        StringType *type = StringType_new();
+        StringType_Set_Stored(type, false);
+        Schema_Spec_Field(schema, field_str, (FieldType*)type);
+        DECREF(type);
+        DECREF(field_str);
+    }
+```
+
+``` perl
 my $cat_type = Lucy::Plan::StringType->new( stored => 0 );
 $schema->spec_field( name => 'category', type => $cat_type );
-~~~
+```
 
 There will be three possible values: "article", "amendment", and "preamble",
 which we'll hack out of the source file's name during our `parse_file`
 subroutine:
 
-~~~ perl
+``` c
+    const char *category = NULL;
+    if (S_starts_with(filename, "art")) {
+        category = "article";
+    }
+    else if (S_starts_with(filename, "amend")) {
+        category = "amendment";
+    }
+    else if (S_starts_with(filename, "preamble")) {
+        category = "preamble";
+    }
+    else {
+        fprintf(stderr, "Can't derive category for %s", filename);
+        exit(1);
+    }
+
+    ...
+
+    {
+        // Store 'category' field
+        String *field = Str_newf("category");
+        String *value = Str_new_from_utf8(category, strlen(category));
+        Doc_Store(doc, field, (Obj*)value);
+        DECREF(field);
+        DECREF(value);
+    }
+```
+
+``` perl
 my $category
     = $filename =~ /art/      ? 'article'
     : $filename =~ /amend/    ? 'amendment'
@@ -40,7 +79,7 @@ return {
     url      => "/us_constitution/$filename",
     category => $category,
 };
-~~~
+```
 
 ## Adaptations to search.cgi
 
@@ -48,7 +87,15 @@ The "category" constraint will be added to our search interface using an HTML
 "select" element (this routine will need to be integrated into the HTML
 generation section of search.cgi):
 
-~~~ perl
+``` c
+static void
+S_usage_and_exit(const char *arg0) {
+    printf("Usage: %s [-c <category>] <querystring>\n", arg0);
+    exit(1);
+}
+```
+
+``` perl
 # Build up the HTML "select" object for the "category" field.
 sub generate_category_select {
     my $cat = shift;
@@ -63,12 +110,38 @@ sub generate_category_select {
     }
     return $select;
 }
-~~~
+```
 
 We'll start off by loading our new modules and extracting our new CGI
 parameter.
 
-~~~ perl
+``` c
+    const char *category = NULL;
+    int i = 1;
+
+    while (i < argc - 1) {
+        if (strcmp(argv[i], "-c") == 0) {
+            if (i + 1 >= argc) {
+                S_usage_and_exit(argv[0]);
+            }
+            i += 1;
+            category = argv[i];
+        }
+        else {
+            S_usage_and_exit(argv[0]);
+        }
+
+        i += 1;
+    }
+
+    if (i + 1 != argc) {
+        S_usage_and_exit(argv[0]);
+    }
+
+    const char *query_c = argv[i];
+```
+
+``` perl
 use Lucy::Search::QueryParser;
 use Lucy::Search::TermQuery;
 use Lucy::Search::ANDQuery;
@@ -76,12 +149,18 @@ use Lucy::Search::ANDQuery;
 ... 
 
 my $category = decode( "UTF-8", $cgi->param('category') || '' );
-~~~
+```
 
 QueryParser's constructor requires a "schema" argument.  We can get that from
 our IndexSearcher:
 
-~~~ perl
+``` c
+    IndexSearcher *searcher = IxSearcher_new((Obj*)folder);
+    Schema        *schema   = IxSearcher_Get_Schema(searcher);
+    QueryParser   *qparser  = QParser_new(schema, NULL, NULL, NULL);
+```
+
+``` perl
 # Create an IndexSearcher and a QueryParser.
 my $searcher = Lucy::Search::IndexSearcher->new( 
     index => $path_to_index, 
@@ -89,21 +168,44 @@ my $searcher = Lucy::Search::IndexSearcher->new(
 my $qparser  = Lucy::Search::QueryParser->new( 
     schema => $searcher->get_schema,
 );
-~~~
+```
 
 Previously, we have been handing raw query strings to IndexSearcher.  Behind
 the scenes, IndexSearcher has been using a QueryParser to turn those query
 strings into Query objects.  Now, we will bring QueryParser into the
 foreground and parse the strings explicitly.
 
-~~~ perl
+``` c
+    Query *query = QParser_Parse(qparser, query_str);
+```
+
+``` perl
 my $query = $qparser->parse($q);
-~~~
+```
 
 If the user has specified a category, we'll use an ANDQuery to join our parsed
 query together with a TermQuery representing the category.
 
-~~~ perl
+``` c
+    if (category) {
+        String *category_name = String_newf("category");
+        String *category_str  = String_newf("%s", category);
+        TermQuery *category_query
+            = TermQuery_new(category_name, category_str);
+
+        Vector *children = Vec_new(2);
+        Vec_Push(children, (Obj*)query);
+        Vec_Push(children, category_query);
+        query = (Query*)ANDQuery_new(children);
+
+        DECREF(children);
+        DECREF(category_str);
+        DECREF(category_name);
+    }
+}
+```
+
+``` perl
 if ($category) {
     my $category_query = Lucy::Search::TermQuery->new(
         field => 'category', 
@@ -113,18 +215,22 @@ if ($category) {
         children => [ $query, $category_query ]
     );
 }
-~~~
+```
 
 Now when we execute the query...
 
-~~~ perl
+``` c
+    Hits *hits = IxSearcher_Hits(searcher, (Obj*)query, 0, 10, NULL);
+```
+
+``` perl
 # Execute the Query and get a Hits object.
 my $hits = $searcher->hits(
     query      => $query,
     offset     => $offset,
     num_wanted => $page_size,
 );
-~~~
+```
 
 ... we'll get a result set which is the intersection of the parsed query and
 the category query.
@@ -137,7 +243,41 @@ term in a FullTextType field directly. In this case, we have to run the
 search term through the field's analyzer to make sure it gets normalized in
 the same way as the field's content.
 
-~~~ perl
+``` c
+Query*
+make_term_query(Schema *schema, String *field, String *term) {
+    FieldType *type  = Schema_Fetch_Type(schema, field);
+    String    *token = NULL;
+
+    if (FieldType_is_a(type, FULLTEXTTYPE)) {
+        // Run the term through the full text analysis chain.
+        Analyzer *analyzer = FullTextType_Get_Analyzer((FullTextType*)type);
+        Vector   *tokens   = Analyzer_Split(analyzer, term);
+
+        if (Vec_Get_Size(tokens) != 1) {
+            // If the term expands to more than one token, or no
+            // tokens at all, it will never match a single token in
+            // the full text field.
+            DECREF(tokens);
+            return (Query*)NoMatchQuery_new();
+        }
+
+        token = (String*)Vec_Delete(tokens, 0);
+        DECREF(tokens);
+    }
+    else {
+        // Exact match for other types.
+        token = (String*)INCREF(term);
+    }
+
+    TermQuery *term_query = TermQuery_new(field, (Obj*)token);
+
+    DECREF(token);
+    return (Query*)term_query;
+}
+```
+
+``` perl
 sub make_term_query {
     my ($field, $term) = @_;
 
@@ -168,7 +308,7 @@ sub make_term_query {
         term  => $token,
     );
 }
-~~~
+```
 
 ## Congratulations!
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/core/Lucy/Docs/Tutorial/SimpleTutorial.md
----------------------------------------------------------------------
diff --git a/core/Lucy/Docs/Tutorial/SimpleTutorial.md b/core/Lucy/Docs/Tutorial/SimpleTutorial.md
index 83883e7..82fbd52 100644
--- a/core/Lucy/Docs/Tutorial/SimpleTutorial.md
+++ b/core/Lucy/Docs/Tutorial/SimpleTutorial.md
@@ -16,7 +16,23 @@ builds a searchable "inverted index" from a collection of documents.
 After we specify some configuration variables and load all necessary
 modules...
 
-~~~ perl
+``` c
+#include <dirent.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#define CFISH_USE_SHORT_NAMES
+#define LUCY_USE_SHORT_NAMES
+#include "Clownfish/String.h"
+#include "Lucy/Simple.h"
+#include "Lucy/Document/Doc.h"
+
+const char path_to_index[] = "lucy_index";
+const char uscon_source[]  = "../../common/sample/us_constitution";
+```
+
+``` perl
 #!/usr/local/bin/perl
 use strict;
 use warnings;
@@ -27,21 +43,93 @@ my $uscon_source  = '/usr/local/apache2/htdocs/us_constitution';
 
 use Lucy::Simple;
 use File::Spec::Functions qw( catfile );
-~~~
+```
 
-... we'll start by creating a Lucy::Simple object, telling it where we'd
-like the index to be located and the language of the source material.
+... we'll start by creating a [Lucy::Simple](lucy.Simple) object, telling it
+where we'd like the index to be located and the language of the source
+material.
 
-~~~ perl
+``` c
+int
+main() {
+    // Initialize the library.
+    lucy_bootstrap_parcel();
+
+    String *folder   = Str_newf("%s", path_to_index);
+    String *language = Str_newf("en");
+    Simple *lucy     = Simple_new((Obj*)folder, language);
+```
+
+``` perl
 my $lucy = Lucy::Simple->new(
     path     => $path_to_index,
     language => 'en',
 );
-~~~
+```
 
 Next, we'll add a subroutine which parses our sample documents.
 
-~~~ perl
+``` c
+Doc*
+S_parse_file(const char *filename) {
+    size_t bytes = strlen(uscon_source) + 1 + strlen(filename) + 1;
+    char *path = (char*)malloc(bytes);
+    path[0] = '\0';
+    strcat(path, uscon_source);
+    strcat(path, "/");
+    strcat(path, filename);
+
+    FILE *stream = fopen(path, "r");
+    if (stream == NULL) {
+        perror(path);
+        exit(1);
+    }
+
+    char *title    = NULL;
+    char *bodytext = NULL;
+    if (fscanf(stream, "%m[^\r\n] %m[\x01-\x7F]", &title, &bodytext) != 2) {
+        fprintf(stderr, "Can't extract title/bodytext from '%s'", path);
+        exit(1);
+    }
+
+    Doc *doc = Doc_new(NULL, 0);
+
+    {
+        // Store 'title' field
+        String *field = Str_newf("title");
+        String *value = Str_new_from_utf8(title, strlen(title));
+        Doc_Store(doc, field, (Obj*)value);
+        DECREF(field);
+        DECREF(value);
+    }
+
+    {
+        // Store 'content' field
+        String *field = Str_newf("content");
+        String *value = Str_new_from_utf8(bodytext, strlen(bodytext));
+        Doc_Store(doc, field, (Obj*)value);
+        DECREF(field);
+        DECREF(value);
+    }
+
+    {
+        // Store 'url' field
+        String *field = Str_newf("url");
+        String *value = Str_new_from_utf8(filename, strlen(filename));
+        Doc_Store(doc, field, (Obj*)value);
+        DECREF(field);
+        DECREF(value);
+    }
+
+    fclose(stream);
+    free(bodytext);
+    free(title);
+    free(path);
+    return doc;
+}
+```
+
+``` perl
 # Parse a file from our US Constitution collection and return a hashref with
 # the fields title, body, and url.
 sub parse_file {
@@ -59,26 +147,55 @@ sub parse_file {
         url      => "/us_constitution/$filename",
     };
 }
-~~~
+```
 
 Add some elementary directory reading code...
 
-~~~ perl
+``` c
+    DIR *dir = opendir(uscon_source);
+    if (dir == NULL) {
+        perror(uscon_source);
+        return 1;
+    }
+```
+
+``` perl
 # Collect names of source files.
 opendir( my $dh, $uscon_source )
     or die "Couldn't opendir '$uscon_source': $!";
 my @filenames = grep { $_ =~ /\.txt/ } readdir $dh;
-~~~
+```
 
 ... and now we're ready for the meat of indexer.pl -- which occupies exactly
 one line of code.
 
-~~~ perl
+``` c
+    for (struct dirent *entry = readdir(dir);
+         entry;
+         entry = readdir(dir)) {
+
+        if (S_ends_with(entry->d_name, ".txt")) {
+            Doc *doc = S_parse_file(entry->d_name);
+            Simple_Add_Doc(lucy, doc); // ta-da!
+            DECREF(doc);
+        }
+    }
+
+    closedir(dir);
+
+    DECREF(lucy);
+    DECREF(language);
+    DECREF(folder);
+    return 0;
+}
+```
+
+``` perl
 foreach my $filename (@filenames) {
     my $doc = parse_file($filename);
     $lucy->add_doc($doc);  # ta-da!
 }
-~~~
+```
 
 ## Search: search.cgi
 
@@ -87,7 +204,40 @@ Lucy-specific.
 
 The beginning is dedicated to CGI processing and configuration.
 
-~~~ perl
+``` c
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#define CFISH_USE_SHORT_NAMES
+#define LUCY_USE_SHORT_NAMES
+#include "Clownfish/String.h"
+#include "Lucy/Document/HitDoc.h"
+#include "Lucy/Simple.h"
+
+const char path_to_index[] = "lucy_index";
+
+static void
+S_usage_and_exit(const char *arg0) {
+    printf("Usage: %s <querystring>\n", arg0);
+    exit(1);
+}
+
+int
+main(int argc, char *argv[]) {
+    // Initialize the library.
+    lucy_bootstrap_parcel();
+
+    if (argc != 2) {
+        S_usage_and_exit(argv[0]);
+    }
+
+    const char *query_c = argv[1];
+
+    printf("Searching for: %s\n\n", query_c);
+```
+
+``` perl
 #!/usr/local/bin/perl -T
 use strict;
 use warnings;
@@ -105,12 +255,21 @@ my $cgi       = CGI->new;
 my $q         = decode( "UTF-8", $cgi->param('q') || '' );
 my $offset    = decode( "UTF-8", $cgi->param('offset') || 0 );
 my $page_size = 10;
-~~~
+```
 
 Once that's out of the way, we create our Lucy::Simple object and feed
 it a query string.
 
-~~~ perl
+``` c
+    String *folder   = Str_newf("%s", path_to_index);
+    String *language = Str_newf("en");
+    Simple *lucy     = Simple_new((Obj*)folder, language);
+
+    String *query_str = Str_newf("%s", query_c);
+    Simple_Search(lucy, query_str, 0, 10);
+```
+
+``` perl
 my $lucy = Lucy::Simple->new(
     path     => $path_to_index,
     language => 'en',
@@ -120,18 +279,52 @@ my $hit_count = $lucy->search(
     offset     => $offset,
     num_wanted => $page_size,
 );
-~~~
+```
 
-The value returned by search() is the total number of documents in the
-collection which matched the query.  We'll show this hit count to the user,
-and also use it in conjunction with the parameters `offset` and `num_wanted`
-to break up results into "pages" of manageable size.
+The value returned by [](lucy.Simple.Search) is the total number of documents
+in the collection which matched the query.  We'll show this hit count to the
+user, and also use it in conjunction with the parameters `offset` and
+`num_wanted` to break up results into "pages" of manageable size.
 
-Calling search() on our Simple object turns it into an iterator. Invoking
-next() now returns hits one at a time as [](cfish:lucy.HitDoc)
+Calling [](lucy.Simple.Search) on our Simple object turns it into an iterator.
+Invoking [](lucy.Simple.Next) now returns hits one at a time as [](lucy.HitDoc)
 objects, starting with the most relevant.
 
-~~~ perl
+``` c
+    String *title_str = Str_newf("title");
+    String *url_str   = Str_newf("url");
+    HitDoc *hit;
+    int i = 1;
+
+    // Loop over search results.
+    while (NULL != (hit = Simple_Next(lucy))) {
+        String *title = (String*)HitDoc_Extract(hit, title_str);
+        char *title_c = Str_To_Utf8(title);
+
+        String *url = (String*)HitDoc_Extract(hit, url_str);
+        char *url_c = Str_To_Utf8(url);
+
+        printf("Result %d: %s (%s)\n", i, title_c, url_c);
+
+        free(url_c);
+        free(title_c);
+        DECREF(url);
+        DECREF(title);
+        DECREF(hit);
+        i++;
+    }
+
+    DECREF(url_str);
+    DECREF(title_str);
+    DECREF(query_str);
+    DECREF(lucy);
+    DECREF(language);
+    DECREF(folder);
+    return 0;
+}
+```
+
+``` perl
 # Create result list.
 my $report = '';
 while ( my $hit = $lucy->next ) {
@@ -145,11 +338,11 @@ while ( my $hit = $lucy->next ) {
         </p>
         |;
 }
-~~~
+```
 
 The rest of the script is just text wrangling. 
 
-~~~ perl5
+``` perl
 #---------------------------------------------------------------#
 # No tutorial material below this point - just html generation. #
 #---------------------------------------------------------------#
@@ -282,7 +475,7 @@ sub blast_out_content {
 </html>
 |;
 }
-~~~
+```
 
 ## OK... now what?
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/perl/buildlib/Lucy/Test/TestUtils.pm
----------------------------------------------------------------------
diff --git a/perl/buildlib/Lucy/Test/TestUtils.pm b/perl/buildlib/Lucy/Test/TestUtils.pm
index 09fa677..add06ec 100644
--- a/perl/buildlib/Lucy/Test/TestUtils.pm
+++ b/perl/buildlib/Lucy/Test/TestUtils.pm
@@ -26,6 +26,7 @@ our @EXPORT_OK = qw(
     working_dir
     create_working_dir
     remove_working_dir
+    uscon_dir
     create_index
     create_uscon_index
     test_index_loc
@@ -40,7 +41,7 @@ our @EXPORT_OK = qw(
 
 use Lucy;
 use Lucy::Test;
-use File::Spec::Functions qw( catdir catfile curdir );
+use File::Spec::Functions qw( catdir catfile curdir updir );
 use Encode qw( _utf8_off );
 use File::Path qw( rmtree );
 use Carp;
@@ -100,10 +101,23 @@ sub create_index {
     return $folder;
 }
 
+sub uscon_dir {
+    my @dirs = (
+        catdir('sample', 'us_constitution'),
+        catdir(updir(), 'common', 'sample', 'us_constitution'),
+    );
+
+    for my $dir (@dirs) {
+        return $dir if -d $dir;
+    }
+
+    die("uscon source dir not found");
+}
+
 # Slurp us constitition docs and build hashrefs.
 sub get_uscon_docs {
 
-    my $uscon_dir = catdir( 'sample', 'us_constitution' );
+    my $uscon_dir = uscon_dir();
     opendir( my $uscon_dh, $uscon_dir )
         or die "couldn't opendir '$uscon_dir': $!";
     my @filenames = grep {/\.txt$/} sort readdir $uscon_dh;

http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/perl/sample/us_constitution/amend1.txt
----------------------------------------------------------------------
diff --git a/perl/sample/us_constitution/amend1.txt b/perl/sample/us_constitution/amend1.txt
deleted file mode 100644
index f410f65..0000000
--- a/perl/sample/us_constitution/amend1.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-Amendment I
-
-Congress shall make no law respecting an establishment of religion, or
-prohibiting the free exercise thereof; or abridging the freedom of speech, or
-of the press; or the right of the people peaceably to assemble, and to
-petition the Government for a redress of grievances.
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/perl/sample/us_constitution/amend10.txt
----------------------------------------------------------------------
diff --git a/perl/sample/us_constitution/amend10.txt b/perl/sample/us_constitution/amend10.txt
deleted file mode 100644
index 10fd290..0000000
--- a/perl/sample/us_constitution/amend10.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-Amendment X
-
-The powers not delegated to the United States by the Constitution, nor
-prohibited by it to the States, are reserved to the States respectively, or
-to the people.
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/perl/sample/us_constitution/amend11.txt
----------------------------------------------------------------------
diff --git a/perl/sample/us_constitution/amend11.txt b/perl/sample/us_constitution/amend11.txt
deleted file mode 100644
index c2a7e3d..0000000
--- a/perl/sample/us_constitution/amend11.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-Amendment XI
-
-The Judicial power of the United States shall not be construed to extend to
-any suit in law or equity, commenced or prosecuted against one of the United
-States by Citizens of another State, or by Citizens or Subjects of any
-Foreign State.
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/perl/sample/us_constitution/amend12.txt
----------------------------------------------------------------------
diff --git a/perl/sample/us_constitution/amend12.txt b/perl/sample/us_constitution/amend12.txt
deleted file mode 100644
index 0906c89..0000000
--- a/perl/sample/us_constitution/amend12.txt
+++ /dev/null
@@ -1,39 +0,0 @@
-Amendment XII
-
-The Electors shall meet in their respective states, and vote by ballot for
-President and Vice-President, one of whom, at least, shall not be an
-inhabitant of the same state with themselves; they shall name in their
-ballots the person voted for as President, and in distinct ballots the person
-voted for as Vice-President, and they shall make distinct lists of all
-persons voted for as President, and of all persons voted for as
-Vice-President and of the number of votes for each, which lists they shall
-sign and certify, and transmit sealed to the seat of the government of the
-United States, directed to the President of the Senate; 
-
-The President of the Senate shall, in the presence of the Senate and House of
-Representatives, open all the certificates and the votes shall then be
-counted; 
-
-The person having the greatest Number of votes for President, shall be the
-President, if such number be a majority of the whole number of Electors
-appointed; and if no person have such majority, then from the persons having
-the highest numbers not exceeding three on the list of those voted for as
-President, the House of Representatives shall choose immediately, by ballot,
-the President. But in choosing the President, the votes shall be taken by
-states, the representation from each state having one vote; a quorum for this
-purpose shall consist of a member or members from two-thirds of the states,
-and a majority of all the states shall be necessary to a choice. And if the
-House of Representatives shall not choose a President whenever the right of
-choice shall devolve upon them, before the fourth day of March next
-following, then the Vice-President shall act as President, as in the case of
-the death or other constitutional disability of the President. 
-
-The person having the greatest number of votes as Vice-President, shall be
-the Vice-President, if such number be a majority of the whole number of
-Electors appointed, and if no person have a majority, then from the two
-highest numbers on the list, the Senate shall choose the Vice-President; a
-quorum for the purpose shall consist of two-thirds of the whole number of
-Senators, and a majority of the whole number shall be necessary to a choice.
-But no person constitutionally ineligible to the office of President shall be
-eligible to that of Vice-President of the United States.
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/perl/sample/us_constitution/amend13.txt
----------------------------------------------------------------------
diff --git a/perl/sample/us_constitution/amend13.txt b/perl/sample/us_constitution/amend13.txt
deleted file mode 100644
index 4a6afd5..0000000
--- a/perl/sample/us_constitution/amend13.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-Amendment XIII
-
-1. Neither slavery nor involuntary servitude, except as a punishment for
-crime whereof the party shall have been duly convicted, shall exist within
-the United States, or any place subject to their jurisdiction. 
-
-2. Congress shall have power to enforce this article by appropriate
-legislation.
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/perl/sample/us_constitution/amend14.txt
----------------------------------------------------------------------
diff --git a/perl/sample/us_constitution/amend14.txt b/perl/sample/us_constitution/amend14.txt
deleted file mode 100644
index 74cb04c..0000000
--- a/perl/sample/us_constitution/amend14.txt
+++ /dev/null
@@ -1,43 +0,0 @@
-Amendment XIV
-
-1. All persons born or naturalized in the United States, and subject to the
-jurisdiction thereof, are citizens of the United States and of the State
-wherein they reside. No State shall make or enforce any law which shall
-abridge the privileges or immunities of citizens of the United States; nor
-shall any State deprive any person of life, liberty, or property, without due
-process of law; nor deny to any person within its jurisdiction the equal
-protection of the laws. 
-
-2. Representatives shall be apportioned among the several States according to
-their respective numbers, counting the whole number of persons in each State,
-excluding Indians not taxed. But when the right to vote at any election for
-the choice of electors for President and Vice-President of the United States,
-Representatives in Congress, the Executive and Judicial officers of a State,
-or the members of the Legislature thereof, is denied to any of the male
-inhabitants of such State, being twenty-one years of age, and citizens of the
-United States, or in any way abridged, except for participation in rebellion,
-or other crime, the basis of representation therein shall be reduced in the
-proportion which the number of such male citizens shall bear to the whole
-number of male citizens twenty-one years of age in such State. 
-
-3. No person shall be a Senator or Representative in Congress, or elector of
-President and Vice-President, or hold any office, civil or military, under
-the United States, or under any State, who, having previously taken an oath,
-as a member of Congress, or as an officer of the United States, or as a
-member of any State legislature, or as an executive or judicial officer of
-any State, to support the Constitution of the United States, shall have
-engaged in insurrection or rebellion against the same, or given aid or
-comfort to the enemies thereof. But Congress may by a vote of two-thirds of
-each House, remove such disability. 
-
-4. The validity of the public debt of the United States, authorized by law,
-including debts incurred for payment of pensions and bounties for services in
-suppressing insurrection or rebellion, shall not be questioned. But neither
-the United States nor any State shall assume or pay any debt or obligation
-incurred in aid of insurrection or rebellion against the United States, or
-any claim for the loss or emancipation of any slave; but all such debts,
-obligations and claims shall be held illegal and void. 
-
-5. The Congress shall have power to enforce, by appropriate legislation, the
-provisions of this article.
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/perl/sample/us_constitution/amend15.txt
----------------------------------------------------------------------
diff --git a/perl/sample/us_constitution/amend15.txt b/perl/sample/us_constitution/amend15.txt
deleted file mode 100644
index ebe8d81..0000000
--- a/perl/sample/us_constitution/amend15.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-Amendment XV
-
-1. The right of citizens of the United States to vote shall not be denied or
-abridged by the United States or by any State on account of race, color, or
-previous condition of servitude. 
-
-2. The Congress shall have power to enforce this article by appropriate
-legislation.
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/perl/sample/us_constitution/amend16.txt
----------------------------------------------------------------------
diff --git a/perl/sample/us_constitution/amend16.txt b/perl/sample/us_constitution/amend16.txt
deleted file mode 100644
index ed6087c..0000000
--- a/perl/sample/us_constitution/amend16.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-Amendment XVI
-
- The Congress shall have power to lay and collect taxes on incomes, from
-whatever source derived, without apportionment among the several States, and
-without regard to any census or enumeration.
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/perl/sample/us_constitution/amend17.txt
----------------------------------------------------------------------
diff --git a/perl/sample/us_constitution/amend17.txt b/perl/sample/us_constitution/amend17.txt
deleted file mode 100644
index 18fbb15..0000000
--- a/perl/sample/us_constitution/amend17.txt
+++ /dev/null
@@ -1,16 +0,0 @@
-Amendment XVII
-
-The Senate of the United States shall be composed of two Senators from each
-State, elected by the people thereof, for six years; and each Senator shall
-have one vote. The electors in each State shall have the qualifications
-requisite for electors of the most numerous branch of the State legislatures. 
-
-When vacancies happen in the representation of any State in the Senate, the
-executive authority of such State shall issue writs of election to fill such
-vacancies: Provided, That the legislature of any State may empower the
-executive thereof to make temporary appointments until the people fill the
-vacancies by election as the legislature may direct. 
-
-This amendment shall not be so construed as to affect the election or term of
-any Senator chosen before it becomes valid as part of the Constitution.
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/perl/sample/us_constitution/amend18.txt
----------------------------------------------------------------------
diff --git a/perl/sample/us_constitution/amend18.txt b/perl/sample/us_constitution/amend18.txt
deleted file mode 100644
index 6e6fab5..0000000
--- a/perl/sample/us_constitution/amend18.txt
+++ /dev/null
@@ -1,16 +0,0 @@
-Amendment XVIII
-
-1. After one year from the ratification of this article the manufacture,
-sale, or transportation of intoxicating liquors within, the importation
-thereof into, or the exportation thereof from the United States and all
-territory subject to the jurisdiction thereof for beverage purposes is hereby
-prohibited. 
-
-2. The Congress and the several States shall have concurrent power to enforce
-this article by appropriate legislation. 
-
-3. This article shall be inoperative unless it shall have been ratified as an
-amendment to the Constitution by the legislatures of the several States, as
-provided in the Constitution, within seven years from the date of the
-submission hereof to the States by the Congress.
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/perl/sample/us_constitution/amend19.txt
----------------------------------------------------------------------
diff --git a/perl/sample/us_constitution/amend19.txt b/perl/sample/us_constitution/amend19.txt
deleted file mode 100644
index ec3c054..0000000
--- a/perl/sample/us_constitution/amend19.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-Amendment XIX
-
-The right of citizens of the United States to vote shall not be denied or
-abridged by the United States or by any State on account of sex. 
-
-Congress shall have power to enforce this article by appropriate legislation.
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/perl/sample/us_constitution/amend2.txt
----------------------------------------------------------------------
diff --git a/perl/sample/us_constitution/amend2.txt b/perl/sample/us_constitution/amend2.txt
deleted file mode 100644
index 3389890..0000000
--- a/perl/sample/us_constitution/amend2.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-Amendment II
-
-A well regulated Militia, being necessary to the security of a free State,
-the right of the people to keep and bear Arms, shall not be infringed. 
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/perl/sample/us_constitution/amend20.txt
----------------------------------------------------------------------
diff --git a/perl/sample/us_constitution/amend20.txt b/perl/sample/us_constitution/amend20.txt
deleted file mode 100644
index 92eeaa0..0000000
--- a/perl/sample/us_constitution/amend20.txt
+++ /dev/null
@@ -1,36 +0,0 @@
-Amendment XX
-
-1. The terms of the President and Vice President shall end at noon on the
-20th day of January, and the terms of Senators and Representatives at noon on
-the 3d day of January, of the years in which such terms would have ended if
-this article had not been ratified; and the terms of their successors shall
-then begin. 
-
-2. The Congress shall assemble at least once in every year, and such meeting
-shall begin at noon on the 3d day of January, unless they shall by law
-appoint a different day. 
-
-3. If, at the time fixed for the beginning of the term of the President, the
-President elect shall have died, the Vice President elect shall become
-President. If a President shall not have been chosen before the time fixed
-for the beginning of his term, or if the President elect shall have failed to
-qualify, then the Vice President elect shall act as President until a
-President shall have qualified; and the Congress may by law provide for the
-case wherein neither a President elect nor a Vice President elect shall have
-qualified, declaring who shall then act as President, or the manner in which
-one who is to act shall be selected, and such person shall act accordingly
-until a President or Vice President shall have qualified. 
-
-4. The Congress may by law provide for the case of the death of any of the
-persons from whom the House of Representatives may choose a President
-whenever the right of choice shall have devolved upon them, and for the case
-of the death of any of the persons from whom the Senate may choose a Vice
-President whenever the right of choice shall have devolved upon them. 
-
-5. Sections 1 and 2 shall take effect on the 15th day of October following
-the ratification of this article. 
-
-6. This article shall be inoperative unless it shall have been ratified as an
-amendment to the Constitution by the legislatures of three-fourths of the
-several States within seven years from the date of its submission.
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/perl/sample/us_constitution/amend21.txt
----------------------------------------------------------------------
diff --git a/perl/sample/us_constitution/amend21.txt b/perl/sample/us_constitution/amend21.txt
deleted file mode 100644
index 4b36e55..0000000
--- a/perl/sample/us_constitution/amend21.txt
+++ /dev/null
@@ -1,14 +0,0 @@
-Amendment XXI
-
-1. The eighteenth article of amendment to the Constitution of the United
-States is hereby repealed. 
-
-2. The transportation or importation into any State, Territory, or possession
-of the United States for delivery or use therein of intoxicating liquors, in
-violation of the laws thereof, is hereby prohibited. 
-
-3. The article shall be inoperative unless it shall have been ratified as an
-amendment to the Constitution by conventions in the several States, as
-provided in the Constitution, within seven years from the date of the
-submission hereof to the States by the Congress.
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/perl/sample/us_constitution/amend22.txt
----------------------------------------------------------------------
diff --git a/perl/sample/us_constitution/amend22.txt b/perl/sample/us_constitution/amend22.txt
deleted file mode 100644
index 782afa9..0000000
--- a/perl/sample/us_constitution/amend22.txt
+++ /dev/null
@@ -1,17 +0,0 @@
-Amendment XXII
-
-1. No person shall be elected to the office of the President more than twice,
-and no person who has held the office of President, or acted as President,
-for more than two years of a term to which some other person was elected
-President shall be elected to the office of the President more than once. But
-this Article shall not apply to any person holding the office of President,
-when this Article was proposed by the Congress, and shall not prevent any
-person who may be holding the office of President, or acting as President,
-during the term within which this Article becomes operative from holding the
-office of President or acting as President during the remainder of such term. 
-
-2. This article shall be inoperative unless it shall have been ratified as an
-amendment to the Constitution by the legislatures of three-fourths of the
-several States within seven years from the date of its submission to the
-States by the Congress.
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/perl/sample/us_constitution/amend23.txt
----------------------------------------------------------------------
diff --git a/perl/sample/us_constitution/amend23.txt b/perl/sample/us_constitution/amend23.txt
deleted file mode 100644
index ce2b31d..0000000
--- a/perl/sample/us_constitution/amend23.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-Amendment XXIII
-
-1. The District constituting the seat of Government of the United States
-shall appoint in such manner as the Congress may direct: A number of electors
-of President and Vice President equal to the whole number of Senators and
-Representatives in Congress to which the District would be entitled if it
-were a State, but in no event more than the least populous State; they shall
-be in addition to those appointed by the States, but they shall be
-considered, for the purposes of the election of President and Vice President,
-to be electors appointed by a State; and they shall meet in the District and
-perform such duties as provided by the twelfth article of amendment. 
-
-2. The Congress shall have power to enforce this article by appropriate
-legislation.
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/perl/sample/us_constitution/amend24.txt
----------------------------------------------------------------------
diff --git a/perl/sample/us_constitution/amend24.txt b/perl/sample/us_constitution/amend24.txt
deleted file mode 100644
index 809b582..0000000
--- a/perl/sample/us_constitution/amend24.txt
+++ /dev/null
@@ -1,11 +0,0 @@
-Amendment XXIV
-
-1. The right of citizens of the United States to vote in any primary or other
-election for President or Vice President, for electors for President or Vice
-President, or for Senator or Representative in Congress, shall not be denied
-or abridged by the United States or any State by reason of failure to pay any
-poll tax or other tax. 
-
-2. The Congress shall have power to enforce this article by appropriate
-legislation.
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/perl/sample/us_constitution/amend25.txt
----------------------------------------------------------------------
diff --git a/perl/sample/us_constitution/amend25.txt b/perl/sample/us_constitution/amend25.txt
deleted file mode 100644
index 69b3472..0000000
--- a/perl/sample/us_constitution/amend25.txt
+++ /dev/null
@@ -1,41 +0,0 @@
-Amendment XXV
-
-1. In case of the removal of the President from office or of his death or
-resignation, the Vice President shall become President. 
-
-2. Whenever there is a vacancy in the office of the Vice President, the
-President shall nominate a Vice President who shall take office upon
-confirmation by a majority vote of both Houses of Congress. 
-
-3. Whenever the President transmits to the President pro tempore of the
-Senate and the Speaker of the House of Representatives his written
-declaration that he is unable to discharge the powers and duties of his
-office, and until he transmits to them a written declaration to the contrary,
-such powers and duties shall be discharged by the Vice President as Acting
-President. 
-
-4. Whenever the Vice President and a majority of either the principal
-officers of the executive departments or of such other body as Congress may
-by law provide, transmit to the President pro tempore of the Senate and the
-Speaker of the House of Representatives their written declaration that the
-President is unable to discharge the powers and duties of his office, the
-Vice President shall immediately assume the powers and duties of the office
-as Acting President. 
-
-Thereafter, when the President transmits to the President pro tempore of the
-Senate and the Speaker of the House of Representatives his written
-declaration that no inability exists, he shall resume the powers and duties
-of his office unless the Vice President and a majority of either the
-principal officers of the executive department or of such other body as
-Congress may by law provide, transmit within four days to the President pro
-tempore of the Senate and the Speaker of the House of Representatives their
-written declaration that the President is unable to discharge the powers and
-duties of his office. Thereupon Congress shall decide the issue, assembling
-within forty eight hours for that purpose if not in session. If the Congress,
-within twenty one days after receipt of the latter written declaration, or,
-if Congress is not in session, within twenty one days after Congress is
-required to assemble, determines by two thirds vote of both Houses that the
-President is unable to discharge the powers and duties of his office, the
-Vice President shall continue to discharge the same as Acting President;
-otherwise, the President shall resume the powers and duties of his office.
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/perl/sample/us_constitution/amend26.txt
----------------------------------------------------------------------
diff --git a/perl/sample/us_constitution/amend26.txt b/perl/sample/us_constitution/amend26.txt
deleted file mode 100644
index 2780a76..0000000
--- a/perl/sample/us_constitution/amend26.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-Amendment XXVI
-
-1. The right of citizens of the United States, who are eighteen years of age
-or older, to vote shall not be denied or abridged by the United States or by
-any State on account of age. 
-
-2. The Congress shall have power to enforce this article by appropriate
-legislation.
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/perl/sample/us_constitution/amend27.txt
----------------------------------------------------------------------
diff --git a/perl/sample/us_constitution/amend27.txt b/perl/sample/us_constitution/amend27.txt
deleted file mode 100644
index 6f10920..0000000
--- a/perl/sample/us_constitution/amend27.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-Amendment XXVII
-
-No law, varying the compensation for the services of the Senators and
-Representatives, shall take effect, until an election of Representatives
-shall have intervened.
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/perl/sample/us_constitution/amend3.txt
----------------------------------------------------------------------
diff --git a/perl/sample/us_constitution/amend3.txt b/perl/sample/us_constitution/amend3.txt
deleted file mode 100644
index edf39e0..0000000
--- a/perl/sample/us_constitution/amend3.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-Amendment III
-
-No Soldier shall, in time of peace be quartered in any house, without the
-consent of the Owner, nor in time of war, but in a manner to be prescribed by
-law.
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/perl/sample/us_constitution/amend4.txt
----------------------------------------------------------------------
diff --git a/perl/sample/us_constitution/amend4.txt b/perl/sample/us_constitution/amend4.txt
deleted file mode 100644
index eb55b4f..0000000
--- a/perl/sample/us_constitution/amend4.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-Amendment IV
-
-The right of the people to be secure in their persons, houses, papers, and
-effects, against unreasonable searches and seizures, shall not be violated,
-and no Warrants shall issue, but upon probable cause, supported by Oath or
-affirmation, and particularly describing the place to be searched, and the
-persons or things to be seized.
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/perl/sample/us_constitution/amend5.txt
----------------------------------------------------------------------
diff --git a/perl/sample/us_constitution/amend5.txt b/perl/sample/us_constitution/amend5.txt
deleted file mode 100644
index f975969..0000000
--- a/perl/sample/us_constitution/amend5.txt
+++ /dev/null
@@ -1,11 +0,0 @@
-Amendment V
-
-No person shall be held to answer for a capital, or otherwise infamous crime,
-unless on a presentment or indictment of a Grand Jury, except in cases
-arising in the land or naval forces, or in the Militia, when in actual
-service in time of War or public danger; nor shall any person be subject for
-the same offense to be twice put in jeopardy of life or limb; nor shall be
-compelled in any criminal case to be a witness against himself, nor be
-deprived of life, liberty, or property, without due process of law; nor shall
-private property be taken for public use, without just compensation.
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/perl/sample/us_constitution/amend6.txt
----------------------------------------------------------------------
diff --git a/perl/sample/us_constitution/amend6.txt b/perl/sample/us_constitution/amend6.txt
deleted file mode 100644
index 38ef75f..0000000
--- a/perl/sample/us_constitution/amend6.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-Amendment VI
-
-In all criminal prosecutions, the accused shall enjoy the right to a speedy
-and public trial, by an impartial jury of the State and district wherein the
-crime shall have been committed, which district shall have been previously
-ascertained by law, and to be informed of the nature and cause of the
-accusation; to be confronted with the witnesses against him; to have
-compulsory process for obtaining witnesses in his favor, and to have the
-Assistance of Counsel for his defence.
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/perl/sample/us_constitution/amend7.txt
----------------------------------------------------------------------
diff --git a/perl/sample/us_constitution/amend7.txt b/perl/sample/us_constitution/amend7.txt
deleted file mode 100644
index f1b9076..0000000
--- a/perl/sample/us_constitution/amend7.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-Amendment VII
-
-In Suits at common law, where the value in controversy shall exceed twenty
-dollars, the right of trial by jury shall be preserved, and no fact tried by
-a jury, shall be otherwise re-examined in any Court of the United States,
-than according to the rules of the common law.
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/perl/sample/us_constitution/amend8.txt
----------------------------------------------------------------------
diff --git a/perl/sample/us_constitution/amend8.txt b/perl/sample/us_constitution/amend8.txt
deleted file mode 100644
index d2abc91..0000000
--- a/perl/sample/us_constitution/amend8.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-Amendment VIII
-
-Excessive bail shall not be required, nor excessive fines imposed, nor cruel
-and unusual punishments inflicted.
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/perl/sample/us_constitution/amend9.txt
----------------------------------------------------------------------
diff --git a/perl/sample/us_constitution/amend9.txt b/perl/sample/us_constitution/amend9.txt
deleted file mode 100644
index 4315578..0000000
--- a/perl/sample/us_constitution/amend9.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-Amendment IX
-
-The enumeration in the Constitution, of certain rights, shall not be
-construed to deny or disparage others retained by the people.
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/perl/sample/us_constitution/art1sec1.txt
----------------------------------------------------------------------
diff --git a/perl/sample/us_constitution/art1sec1.txt b/perl/sample/us_constitution/art1sec1.txt
deleted file mode 100644
index 81e49fd..0000000
--- a/perl/sample/us_constitution/art1sec1.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-Article I Section 1
-
-All legislative Powers herein granted shall be vested in a Congress of the
-United States, which shall consist of a Senate and House of Representatives. 
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/perl/sample/us_constitution/art1sec10.txt
----------------------------------------------------------------------
diff --git a/perl/sample/us_constitution/art1sec10.txt b/perl/sample/us_constitution/art1sec10.txt
deleted file mode 100644
index e8362e4..0000000
--- a/perl/sample/us_constitution/art1sec10.txt
+++ /dev/null
@@ -1,20 +0,0 @@
-Article I Section 10
-
-No State shall enter into any Treaty, Alliance, or Confederation; grant
-Letters of Marque and Reprisal; coin Money; emit Bills of Credit; make any
-Thing but gold and silver Coin a Tender in Payment of Debts; pass any Bill of
-Attainder, ex post facto Law, or Law impairing the Obligation of Contracts,
-or grant any Title of Nobility. 
-
-No State shall, without the Consent of the Congress, lay any Imposts or
-Duties on Imports or Exports, except what may be absolutely necessary for
-executing it's inspection Laws: and the net Produce of all Duties and
-Imposts, laid by any State on Imports or Exports, shall be for the Use of the
-Treasury of the United States; and all such Laws shall be subject to the
-Revision and Controul of the Congress. 
-
-No State shall, without the Consent of Congress, lay any duty of Tonnage,
-keep Troops, or Ships of War in time of Peace, enter into any Agreement or
-Compact with another State, or with a foreign Power, or engage in War, unless
-actually invaded, or in such imminent Danger as will not admit of delay.
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/perl/sample/us_constitution/art1sec2.txt
----------------------------------------------------------------------
diff --git a/perl/sample/us_constitution/art1sec2.txt b/perl/sample/us_constitution/art1sec2.txt
deleted file mode 100644
index d3bf23c..0000000
--- a/perl/sample/us_constitution/art1sec2.txt
+++ /dev/null
@@ -1,35 +0,0 @@
-Article I Section 2
-
-The House of Representatives shall be composed of Members chosen every second
-Year by the People of the several States, and the Electors in each State
-shall have the Qualifications requisite for Electors of the most numerous
-Branch of the State Legislature. 
-
-No Person shall be a Representative who shall not have attained to the Age of
-twenty five Years, and been seven Years a Citizen of the United States, and
-who shall not, when elected, be an Inhabitant of that State in which he shall
-be chosen. 
-
-Representatives and direct Taxes shall be apportioned among the several
-States which may be included within this Union, according to their respective
-Numbers, which shall be determined by adding to the whole Number of free
-Persons, including those bound to Service for a Term of Years, and excluding
-Indians not taxed, three fifths of all other Persons. 
-
-The actual Enumeration shall be made within three Years after the first
-Meeting of the Congress of the United States, and within every subsequent
-Term of ten Years, in such Manner as they shall by Law direct. The Number of
-Representatives shall not exceed one for every thirty Thousand, but each
-State shall have at Least one Representative; and until such enumeration
-shall be made, the State of New Hampshire shall be entitled to chuse three,
-Massachusetts eight, Rhode Island and Providence Plantations one, Connecticut
-five, New York six, New Jersey four, Pennsylvania eight, Delaware one,
-Maryland six, Virginia ten, North Carolina five, South Carolina five and
-Georgia three. 
-
-When vacancies happen in the Representation from any State, the Executive
-Authority thereof shall issue Writs of Election to fill such Vacancies. 
-
-The House of Representatives shall chuse their Speaker and other Officers;
-and shall have the sole Power of Impeachment. 
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/perl/sample/us_constitution/art1sec3.txt
----------------------------------------------------------------------
diff --git a/perl/sample/us_constitution/art1sec3.txt b/perl/sample/us_constitution/art1sec3.txt
deleted file mode 100644
index 3e2f4cc..0000000
--- a/perl/sample/us_constitution/art1sec3.txt
+++ /dev/null
@@ -1,39 +0,0 @@
-Article I Section 3
-
-The Senate of the United States shall be composed of two Senators from each
-State, chosen by the Legislature thereof, for six Years; and each Senator
-shall have one Vote. 
-
-Immediately after they shall be assembled in Consequence of the first
-Election, they shall be divided as equally as may be into three Classes. The
-Seats of the Senators of the first Class shall be vacated at the Expiration
-of the second Year, of the second Class at the Expiration of the fourth Year,
-and of the third Class at the Expiration of the sixth Year, so that one third
-may be chosen every second Year; and if Vacancies happen by Resignation, or
-otherwise, during the Recess of the Legislature of any State, the Executive
-thereof may make temporary Appointments until the next Meeting of the
-Legislature, which shall then fill such Vacancies. 
-
-No person shall be a Senator who shall not have attained to the Age of thirty
-Years, and been nine Years a Citizen of the United States, and who shall not,
-when elected, be an Inhabitant of that State for which he shall be chosen. 
-
-The Vice President of the United States shall be President of the Senate, but
-shall have no Vote, unless they be equally divided. 
-
-The Senate shall chuse their other Officers, and also a President pro
-tempore, in the absence of the Vice President, or when he shall exercise the
-Office of President of the United States. 
-
-The Senate shall have the sole Power to try all Impeachments. When sitting
-for that Purpose, they shall be on Oath or Affirmation. When the President of
-the United States is tried, the Chief Justice shall preside: And no Person
-shall be convicted without the Concurrence of two thirds of the Members
-present. 
-
-Judgment in Cases of Impeachment shall not extend further than to removal
-from Office, and disqualification to hold and enjoy any Office of honor,
-Trust or Profit under the United States: but the Party convicted shall
-nevertheless be liable and subject to Indictment, Trial, Judgment and
-Punishment, according to Law.
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/perl/sample/us_constitution/art1sec4.txt
----------------------------------------------------------------------
diff --git a/perl/sample/us_constitution/art1sec4.txt b/perl/sample/us_constitution/art1sec4.txt
deleted file mode 100644
index 967f7ff..0000000
--- a/perl/sample/us_constitution/art1sec4.txt
+++ /dev/null
@@ -1,11 +0,0 @@
-Article I Section 4
-
-The Times, Places and Manner of holding Elections for Senators and
-Representatives, shall be prescribed in each State by the Legislature
-thereof; but the Congress may at any time by Law make or alter such
-Regulations, except as to the Place of Chusing Senators. 
-
-The Congress shall assemble at least once in every Year, and such Meeting
-shall be on the first Monday in December, unless they shall by Law appoint a
-different Day.
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/perl/sample/us_constitution/art1sec5.txt
----------------------------------------------------------------------
diff --git a/perl/sample/us_constitution/art1sec5.txt b/perl/sample/us_constitution/art1sec5.txt
deleted file mode 100644
index 5190f1e..0000000
--- a/perl/sample/us_constitution/art1sec5.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-Article I Section 5
-
-Each House shall be the Judge of the Elections, Returns and Qualifications of
-its own Members, and a Majority of each shall constitute a Quorum to do
-Business; but a smaller number may adjourn from day to day, and may be
-authorized to compel the Attendance of absent Members, in such Manner, and
-under such Penalties as each House may provide. 
-
-Each House may determine the Rules of its Proceedings, punish its Members for
-disorderly Behavior, and, with the Concurrence of two-thirds, expel a Member. 
-
-Each House shall keep a Journal of its Proceedings, and from time to time
-publish the same, excepting such Parts as may in their Judgment require
-Secrecy; and the Yeas and Nays of the Members of either House on any question
-shall, at the Desire of one fifth of those Present, be entered on the
-Journal. 
-
-Neither House, during the Session of Congress, shall, without the Consent of
-the other, adjourn for more than three days, nor to any other Place than that
-in which the two Houses shall be sitting.
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/perl/sample/us_constitution/art1sec6.txt
----------------------------------------------------------------------
diff --git a/perl/sample/us_constitution/art1sec6.txt b/perl/sample/us_constitution/art1sec6.txt
deleted file mode 100644
index 2351866..0000000
--- a/perl/sample/us_constitution/art1sec6.txt
+++ /dev/null
@@ -1,16 +0,0 @@
-Article I Section 6
-
-The Senators and Representatives shall receive a Compensation for their
-Services, to be ascertained by Law, and paid out of the Treasury of the
-United States. They shall in all Cases, except Treason, Felony and Breach of
-the Peace, be privileged from Arrest during their Attendance at the Session
-of their respective Houses, and in going to and returning from the same; and
-for any Speech or Debate in either House, they shall not be questioned in any
-other Place. 
-
-No Senator or Representative shall, during the Time for which he was elected,
-be appointed to any civil Office under the Authority of the United States
-which shall have been created, or the Emoluments whereof shall have been
-increased during such time; and no Person holding any Office under the United
-States, shall be a Member of either House during his Continuance in Office.
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/perl/sample/us_constitution/art1sec7.txt
----------------------------------------------------------------------
diff --git a/perl/sample/us_constitution/art1sec7.txt b/perl/sample/us_constitution/art1sec7.txt
deleted file mode 100644
index e7a9444..0000000
--- a/perl/sample/us_constitution/art1sec7.txt
+++ /dev/null
@@ -1,31 +0,0 @@
-Article I Section 7
-
-All bills for raising Revenue shall originate in the House of
-Representatives; but the Senate may propose or concur with Amendments as on
-other Bills. 
-
-Every Bill which shall have passed the House of Representatives and the
-Senate, shall, before it become a Law, be presented to the President of the
-United States; If he approve he shall sign it, but if not he shall return it,
-with his Objections to that House in which it shall have originated, who
-shall enter the Objections at large on their Journal, and proceed to
-reconsider it. If after such Reconsideration two thirds of that House shall
-agree to pass the Bill, it shall be sent, together with the Objections, to
-the other House, by which it shall likewise be reconsidered, and if approved
-by two thirds of that House, it shall become a Law. But in all such Cases the
-Votes of both Houses shall be determined by Yeas and Nays, and the Names of
-the Persons voting for and against the Bill shall be entered on the Journal
-of each House respectively. If any Bill shall not be returned by the
-President within ten Days (Sundays excepted) after it shall have been
-presented to him, the Same shall be a Law, in like Manner as if he had signed
-it, unless the Congress by their Adjournment prevent its Return, in which
-Case it shall not be a Law. 
-
-Every Order, Resolution, or Vote to which the Concurrence of the Senate and
-House of Representatives may be necessary (except on a question of
-Adjournment) shall be presented to the President of the United States; and
-before the Same shall take Effect, shall be approved by him, or being
-disapproved by him, shall be repassed by two thirds of the Senate and House
-of Representatives, according to the Rules and Limitations prescribed in the
-Case of a Bill.
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/perl/sample/us_constitution/art1sec8.txt
----------------------------------------------------------------------
diff --git a/perl/sample/us_constitution/art1sec8.txt b/perl/sample/us_constitution/art1sec8.txt
deleted file mode 100644
index d8dd374..0000000
--- a/perl/sample/us_constitution/art1sec8.txt
+++ /dev/null
@@ -1,64 +0,0 @@
-Article I Section 8
-
-The Congress shall have Power To lay and collect Taxes, Duties, Imposts and
-Excises, to pay the Debts and provide for the common Defence and general
-Welfare of the United States; but all Duties, Imposts and Excises shall be
-uniform throughout the United States; 
-
-To borrow money on the credit of the United States; 
-
-To regulate Commerce with foreign Nations, and among the several States, and
-with the Indian Tribes; 
-
-To establish an uniform Rule of Naturalization, and uniform Laws on the
-subject of Bankruptcies throughout the United States; 
-
-To coin Money, regulate the Value thereof, and of foreign Coin, and fix the
-Standard of Weights and Measures; 
-
-To provide for the Punishment of counterfeiting the Securities and current
-Coin of the United States; 
-
-To establish Post Offices and Post Roads; 
-
-To promote the Progress of Science and useful Arts, by securing for limited
-Times to Authors and Inventors the exclusive Right to their respective
-Writings and Discoveries; 
-
-To constitute Tribunals inferior to the supreme Court; 
-
-To define and punish Piracies and Felonies committed on the high Seas, and
-Offenses against the Law of Nations; 
-
-To declare War, grant Letters of Marque and Reprisal, and make Rules
-concerning Captures on Land and Water; 
-
-To raise and support Armies, but no Appropriation of Money to that Use shall
-be for a longer Term than two Years; 
-
-To provide and maintain a Navy; 
-
-To make Rules for the Government and Regulation of the land and naval Forces; 
-
-To provide for calling forth the Militia to execute the Laws of the Union,
-suppress Insurrections and repel Invasions; 
-
-To provide for organizing, arming, and disciplining the Militia, and for
-governing such Part of them as may be employed in the Service of the United
-States, reserving to the States respectively, the Appointment of the
-Officers, and the Authority of training the Militia according to the
-discipline prescribed by Congress; 
-
-To exercise exclusive Legislation in all Cases whatsoever, over such District
-(not exceeding ten Miles square) as may, by Cession of particular States, and
-the acceptance of Congress, become the Seat of the Government of the United
-States, and to exercise like Authority over all Places purchased by the
-Consent of the Legislature of the State in which the Same shall be, for the
-Erection of Forts, Magazines, Arsenals, dock-Yards, and other needful
-Buildings; And 
-
-To make all Laws which shall be necessary and proper for carrying into
-Execution the foregoing Powers, and all other Powers vested by this
-Constitution in the Government of the United States, or in any Department or
-Officer thereof. 
-


[6/6] lucy git commit: Fix remaining links to standalone documentation

Posted by nw...@apache.org.
Fix remaining links to standalone documentation


Project: http://git-wip-us.apache.org/repos/asf/lucy/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/45eac391
Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/45eac391
Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/45eac391

Branch: refs/heads/master
Commit: 45eac391a21fa1d0f5b8e76f3aa9c03444f9838c
Parents: dcc6215
Author: Nick Wellnhofer <we...@aevum.de>
Authored: Thu Aug 6 19:45:46 2015 +0200
Committer: Nick Wellnhofer <we...@aevum.de>
Committed: Thu Aug 6 20:27:38 2015 +0200

----------------------------------------------------------------------
 core/Lucy/Index/Indexer.cfh     | 4 ++--
 core/Lucy/Index/Posting.cfh     | 2 +-
 core/Lucy/Index/PostingList.cfh | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy/blob/45eac391/core/Lucy/Index/Indexer.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/Indexer.cfh b/core/Lucy/Index/Indexer.cfh
index b421c0c..4ee07ef 100644
--- a/core/Lucy/Index/Indexer.cfh
+++ b/core/Lucy/Index/Indexer.cfh
@@ -29,7 +29,7 @@ parcel Lucy;
  * identify itself by supplying an
  * [](cfish:IndexManager) with a unique
  * `host` id to Indexer's constructor or index corruption will
- * occur.  See [FileLocking](Lucy::Docs::FileLocking) for a detailed
+ * occur.  See [](FileLocking) for a detailed
  * discussion.
  *
  * Note: at present, [](cfish:.Delete_By_Term) and [](cfish:.Delete_By_Query) only affect
@@ -115,7 +115,7 @@ public class Lucy::Index::Indexer inherits Clownfish::Obj {
 
     /** Mark the document identified by the supplied document ID as deleted.
      *
-     * @param doc_id A [document id](Lucy::Docs::DocIDs).
+     * @param doc_id A [document id](DocIDs).
      */
     public void
     Delete_By_Doc_ID(Indexer *self, int32_t doc_id);

http://git-wip-us.apache.org/repos/asf/lucy/blob/45eac391/core/Lucy/Index/Posting.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/Posting.cfh b/core/Lucy/Index/Posting.cfh
index ff2a638..1c243bd 100644
--- a/core/Lucy/Index/Posting.cfh
+++ b/core/Lucy/Index/Posting.cfh
@@ -19,7 +19,7 @@ parcel Lucy;
 /** Vessel holding statistical data for a posting.
  *
  * A Posting, in Apache Lucy, is a vessel which stores information about a
- * term-document match.  (See [IRTheory](Lucy::Docs::IRTheory) for the
+ * term-document match.  (See [](IRTheory) for the
  * academic definition of "posting".)
  *
  * Subclasses include

http://git-wip-us.apache.org/repos/asf/lucy/blob/45eac391/core/Lucy/Index/PostingList.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/PostingList.cfh b/core/Lucy/Index/PostingList.cfh
index d5d80e6..609acf8 100644
--- a/core/Lucy/Index/PostingList.cfh
+++ b/core/Lucy/Index/PostingList.cfh
@@ -21,7 +21,7 @@ parcel Lucy;
  * PostingList is an iterator which supplies a list of document ids that match
  * a given term.
  *
- * See [IRTheory](Lucy::Docs::IRTheory) for definitions of "posting" and
+ * See [](IRTheory) for definitions of "posting" and
  * "posting list".
  */
 public class Lucy::Index::PostingList nickname PList


[5/6] lucy git commit: C code examples for tutorial

Posted by nw...@apache.org.
C code examples for tutorial


Project: http://git-wip-us.apache.org/repos/asf/lucy/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/dcc62153
Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/dcc62153
Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/dcc62153

Branch: refs/heads/master
Commit: dcc62153f75a9108d710d64ea50884985d3b6c24
Parents: ffeebb8
Author: Nick Wellnhofer <we...@aevum.de>
Authored: Mon Jul 27 18:36:50 2015 +0200
Committer: Nick Wellnhofer <we...@aevum.de>
Committed: Thu Aug 6 20:27:38 2015 +0200

----------------------------------------------------------------------
 c/sample/indexer.c                              | 207 ++++++++++++++++
 c/sample/indexer_simple.c                       | 115 +++++++++
 c/sample/search.c                               | 127 ++++++++++
 c/sample/search_simple.c                        |  70 ++++++
 common/sample/us_constitution/amend1.txt        |   7 +
 common/sample/us_constitution/amend10.txt       |   6 +
 common/sample/us_constitution/amend11.txt       |   7 +
 common/sample/us_constitution/amend12.txt       |  39 +++
 common/sample/us_constitution/amend13.txt       |   9 +
 common/sample/us_constitution/amend14.txt       |  43 ++++
 common/sample/us_constitution/amend15.txt       |   9 +
 common/sample/us_constitution/amend16.txt       |   6 +
 common/sample/us_constitution/amend17.txt       |  16 ++
 common/sample/us_constitution/amend18.txt       |  16 ++
 common/sample/us_constitution/amend19.txt       |   7 +
 common/sample/us_constitution/amend2.txt        |   5 +
 common/sample/us_constitution/amend20.txt       |  36 +++
 common/sample/us_constitution/amend21.txt       |  14 ++
 common/sample/us_constitution/amend22.txt       |  17 ++
 common/sample/us_constitution/amend23.txt       |  15 ++
 common/sample/us_constitution/amend24.txt       |  11 +
 common/sample/us_constitution/amend25.txt       |  41 ++++
 common/sample/us_constitution/amend26.txt       |   9 +
 common/sample/us_constitution/amend27.txt       |   6 +
 common/sample/us_constitution/amend3.txt        |   6 +
 common/sample/us_constitution/amend4.txt        |   8 +
 common/sample/us_constitution/amend5.txt        |  11 +
 common/sample/us_constitution/amend6.txt        |  10 +
 common/sample/us_constitution/amend7.txt        |   7 +
 common/sample/us_constitution/amend8.txt        |   5 +
 common/sample/us_constitution/amend9.txt        |   5 +
 common/sample/us_constitution/art1sec1.txt      |   5 +
 common/sample/us_constitution/art1sec10.txt     |  20 ++
 common/sample/us_constitution/art1sec2.txt      |  35 +++
 common/sample/us_constitution/art1sec3.txt      |  39 +++
 common/sample/us_constitution/art1sec4.txt      |  11 +
 common/sample/us_constitution/art1sec5.txt      |  21 ++
 common/sample/us_constitution/art1sec6.txt      |  16 ++
 common/sample/us_constitution/art1sec7.txt      |  31 +++
 common/sample/us_constitution/art1sec8.txt      |  64 +++++
 common/sample/us_constitution/art1sec9.txt      |  30 +++
 common/sample/us_constitution/art2sec1.txt      |  65 +++++
 common/sample/us_constitution/art2sec2.txt      |  24 ++
 common/sample/us_constitution/art2sec3.txt      |  11 +
 common/sample/us_constitution/art2sec4.txt      |   6 +
 common/sample/us_constitution/art3sec1.txt      |   9 +
 common/sample/us_constitution/art3sec2.txt      |  24 ++
 common/sample/us_constitution/art3sec3.txt      |  11 +
 common/sample/us_constitution/art4sec1.txt      |   7 +
 common/sample/us_constitution/art4sec2.txt      |  15 ++
 common/sample/us_constitution/art4sec3.txt      |  13 +
 common/sample/us_constitution/art4sec4.txt      |   7 +
 common/sample/us_constitution/art5.txt          |  14 ++
 common/sample/us_constitution/art6.txt          |  19 ++
 common/sample/us_constitution/art7.txt          |  43 ++++
 common/sample/us_constitution/index.html        | 114 +++++++++
 common/sample/us_constitution/preamble.txt      |   8 +
 common/sample/us_constitution/uscon.css         |  45 ++++
 core/Lucy/Docs/Tutorial.md                      |  12 +-
 core/Lucy/Docs/Tutorial/AnalysisTutorial.md     |  71 ++++--
 core/Lucy/Docs/Tutorial/BeyondSimpleTutorial.md | 205 ++++++++++++++--
 core/Lucy/Docs/Tutorial/FieldTypeTutorial.md    |  55 ++++-
 core/Lucy/Docs/Tutorial/HighlighterTutorial.md  |  71 +++++-
 core/Lucy/Docs/Tutorial/QueryObjectsTutorial.md | 176 +++++++++++--
 core/Lucy/Docs/Tutorial/SimpleTutorial.md       | 245 +++++++++++++++++--
 perl/buildlib/Lucy/Test/TestUtils.pm            |  18 +-
 perl/sample/us_constitution/amend1.txt          |   7 -
 perl/sample/us_constitution/amend10.txt         |   6 -
 perl/sample/us_constitution/amend11.txt         |   7 -
 perl/sample/us_constitution/amend12.txt         |  39 ---
 perl/sample/us_constitution/amend13.txt         |   9 -
 perl/sample/us_constitution/amend14.txt         |  43 ----
 perl/sample/us_constitution/amend15.txt         |   9 -
 perl/sample/us_constitution/amend16.txt         |   6 -
 perl/sample/us_constitution/amend17.txt         |  16 --
 perl/sample/us_constitution/amend18.txt         |  16 --
 perl/sample/us_constitution/amend19.txt         |   7 -
 perl/sample/us_constitution/amend2.txt          |   5 -
 perl/sample/us_constitution/amend20.txt         |  36 ---
 perl/sample/us_constitution/amend21.txt         |  14 --
 perl/sample/us_constitution/amend22.txt         |  17 --
 perl/sample/us_constitution/amend23.txt         |  15 --
 perl/sample/us_constitution/amend24.txt         |  11 -
 perl/sample/us_constitution/amend25.txt         |  41 ----
 perl/sample/us_constitution/amend26.txt         |   9 -
 perl/sample/us_constitution/amend27.txt         |   6 -
 perl/sample/us_constitution/amend3.txt          |   6 -
 perl/sample/us_constitution/amend4.txt          |   8 -
 perl/sample/us_constitution/amend5.txt          |  11 -
 perl/sample/us_constitution/amend6.txt          |  10 -
 perl/sample/us_constitution/amend7.txt          |   7 -
 perl/sample/us_constitution/amend8.txt          |   5 -
 perl/sample/us_constitution/amend9.txt          |   5 -
 perl/sample/us_constitution/art1sec1.txt        |   5 -
 perl/sample/us_constitution/art1sec10.txt       |  20 --
 perl/sample/us_constitution/art1sec2.txt        |  35 ---
 perl/sample/us_constitution/art1sec3.txt        |  39 ---
 perl/sample/us_constitution/art1sec4.txt        |  11 -
 perl/sample/us_constitution/art1sec5.txt        |  21 --
 perl/sample/us_constitution/art1sec6.txt        |  16 --
 perl/sample/us_constitution/art1sec7.txt        |  31 ---
 perl/sample/us_constitution/art1sec8.txt        |  64 -----
 perl/sample/us_constitution/art1sec9.txt        |  30 ---
 perl/sample/us_constitution/art2sec1.txt        |  65 -----
 perl/sample/us_constitution/art2sec2.txt        |  24 --
 perl/sample/us_constitution/art2sec3.txt        |  11 -
 perl/sample/us_constitution/art2sec4.txt        |   6 -
 perl/sample/us_constitution/art3sec1.txt        |   9 -
 perl/sample/us_constitution/art3sec2.txt        |  24 --
 perl/sample/us_constitution/art3sec3.txt        |  11 -
 perl/sample/us_constitution/art4sec1.txt        |   7 -
 perl/sample/us_constitution/art4sec2.txt        |  15 --
 perl/sample/us_constitution/art4sec3.txt        |  13 -
 perl/sample/us_constitution/art4sec4.txt        |   7 -
 perl/sample/us_constitution/art5.txt            |  14 --
 perl/sample/us_constitution/art6.txt            |  19 --
 perl/sample/us_constitution/art7.txt            |  43 ----
 perl/sample/us_constitution/index.html          | 114 ---------
 perl/sample/us_constitution/preamble.txt        |   8 -
 perl/sample/us_constitution/uscon.css           |  45 ----
 perl/t/binding/702-sample.t                     |   3 +-
 121 files changed, 2355 insertions(+), 1176 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/c/sample/indexer.c
----------------------------------------------------------------------
diff --git a/c/sample/indexer.c b/c/sample/indexer.c
new file mode 100644
index 0000000..1a00fd7
--- /dev/null
+++ b/c/sample/indexer.c
@@ -0,0 +1,207 @@
+#include <dirent.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#define CFISH_USE_SHORT_NAMES
+#define LUCY_USE_SHORT_NAMES
+#include "Clownfish/String.h"
+#include "Lucy/Analysis/EasyAnalyzer.h"
+#include "Lucy/Document/Doc.h"
+#include "Lucy/Index/Indexer.h"
+#include "Lucy/Plan/FullTextType.h"
+#include "Lucy/Plan/StringType.h"
+#include "Lucy/Plan/Schema.h"
+
+const char path_to_index[] = "lucy_index";
+const char uscon_source[]  = "../../common/sample/us_constitution";
+
+static Schema*
+S_create_schema() {
+    // Create a new schema.
+    Schema *schema = Schema_new();
+
+    // Create an analyzer.
+    String       *language = Str_newf("en");
+    EasyAnalyzer *analyzer = EasyAnalyzer_new(language);
+
+    // Specify fields.
+
+    {
+        String *field_str = Str_newf("title");
+        FullTextType *type = FullTextType_new((Analyzer*)analyzer);
+        Schema_Spec_Field(schema, field_str, (FieldType*)type);
+        DECREF(type);
+        DECREF(field_str);
+    }
+
+    {
+        String *field_str = Str_newf("content");
+        FullTextType *type = FullTextType_new((Analyzer*)analyzer);
+        FullTextType_Set_Highlightable(type, true);
+        Schema_Spec_Field(schema, field_str, (FieldType*)type);
+        DECREF(type);
+        DECREF(field_str);
+    }
+
+    {
+        String *field_str = Str_newf("url");
+        StringType *type = StringType_new();
+        StringType_Set_Indexed(type, false);
+        Schema_Spec_Field(schema, field_str, (FieldType*)type);
+        DECREF(type);
+        DECREF(field_str);
+    }
+
+    {
+        String *field_str = Str_newf("category");
+        StringType *type = StringType_new();
+        StringType_Set_Stored(type, false);
+        Schema_Spec_Field(schema, field_str, (FieldType*)type);
+        DECREF(type);
+        DECREF(field_str);
+    }
+
+    DECREF(analyzer);
+    DECREF(language);
+    return schema;
+}
+
+bool
+S_starts_with(const char *str, const char *prefix) {
+    size_t len        = strlen(str);
+    size_t prefix_len = strlen(prefix);
+
+    return len >= prefix_len
+           && memcmp(str, prefix, prefix_len) == 0;
+}
+
+bool
+S_ends_with(const char *str, const char *postfix) {
+    size_t len         = strlen(str);
+    size_t postfix_len = strlen(postfix);
+
+    return len >= postfix_len
+           && memcmp(str + len - postfix_len, postfix, postfix_len) == 0;
+}
+
+Doc*
+S_parse_file(const char *filename) {
+    size_t bytes = strlen(uscon_source) + 1 + strlen(filename) + 1;
+    char *path = (char*)malloc(bytes);
+    path[0] = '\0';
+    strcat(path, uscon_source);
+    strcat(path, "/");
+    strcat(path, filename);
+
+    FILE *stream = fopen(path, "r");
+    if (stream == NULL) {
+        perror(path);
+        exit(1);
+    }
+
+    char *title    = NULL;
+    char *bodytext = NULL;
+    if (fscanf(stream, "%m[^\r\n] %m[\x01-\x7F]", &title, &bodytext) != 2) {
+        fprintf(stderr, "Can't extract title/bodytext from '%s'", path);
+        exit(1);
+    }
+
+    const char *category = NULL;
+    if (S_starts_with(filename, "art")) {
+        category = "article";
+    }
+    else if (S_starts_with(filename, "amend")) {
+        category = "amendment";
+    }
+    else if (S_starts_with(filename, "preamble")) {
+        category = "preamble";
+    }
+    else {
+        fprintf(stderr, "Can't derive category for %s", filename);
+        exit(1);
+    }
+
+    Doc *doc = Doc_new(NULL, 0);
+
+    {
+        // Store 'title' field
+        String *field = Str_newf("title");
+        String *value = Str_new_from_utf8(title, strlen(title));
+        Doc_Store(doc, field, (Obj*)value);
+        DECREF(field);
+        DECREF(value);
+    }
+
+    {
+        // Store 'content' field
+        String *field = Str_newf("content");
+        String *value = Str_new_from_utf8(bodytext, strlen(bodytext));
+        Doc_Store(doc, field, (Obj*)value);
+        DECREF(field);
+        DECREF(value);
+    }
+
+    {
+        // Store 'url' field
+        String *field = Str_newf("url");
+        String *value = Str_new_from_utf8(filename, strlen(filename));
+        Doc_Store(doc, field, (Obj*)value);
+        DECREF(field);
+        DECREF(value);
+    }
+
+    {
+        // Store 'category' field
+        String *field = Str_newf("category");
+        String *value = Str_new_from_utf8(category, strlen(category));
+        Doc_Store(doc, field, (Obj*)value);
+        DECREF(field);
+        DECREF(value);
+    }
+
+    fclose(stream);
+    free(bodytext);
+    free(title);
+    free(path);
+    return doc;
+}
+
+int
+main() {
+    // Initialize the library.
+    lucy_bootstrap_parcel();
+
+    Schema *schema = S_create_schema();
+    String *folder = Str_newf("%s", path_to_index);
+
+    Indexer *indexer = Indexer_new(schema, (Obj*)folder, NULL,
+                                   Indexer_CREATE | Indexer_TRUNCATE);
+
+    DIR *dir = opendir(uscon_source);
+    if (dir == NULL) {
+        perror(uscon_source);
+        return 1;
+    }
+
+    for (struct dirent *entry = readdir(dir);
+         entry;
+         entry = readdir(dir)) {
+
+        if (S_ends_with(entry->d_name, ".txt")) {
+            Doc *doc = S_parse_file(entry->d_name);
+            Indexer_Add_Doc(indexer, doc, 1.0);
+            DECREF(doc);
+        }
+    }
+
+    closedir(dir);
+
+    Indexer_Commit(indexer);
+
+    DECREF(indexer);
+    DECREF(folder);
+    DECREF(schema);
+    return 0;
+}
+

http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/c/sample/indexer_simple.c
----------------------------------------------------------------------
diff --git a/c/sample/indexer_simple.c b/c/sample/indexer_simple.c
new file mode 100644
index 0000000..a348969
--- /dev/null
+++ b/c/sample/indexer_simple.c
@@ -0,0 +1,115 @@
+#include <dirent.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#define CFISH_USE_SHORT_NAMES
+#define LUCY_USE_SHORT_NAMES
+#include "Clownfish/String.h"
+#include "Lucy/Simple.h"
+#include "Lucy/Document/Doc.h"
+
+const char path_to_index[] = "lucy_index";
+const char uscon_source[]  = "../../common/sample/us_constitution";
+
+bool
+S_ends_with(const char *str, const char *postfix) {
+    size_t len         = strlen(str);
+    size_t postfix_len = strlen(postfix);
+
+    return len >= postfix_len
+           && memcmp(str + len - postfix_len, postfix, postfix_len) == 0;
+}
+
+Doc*
+S_parse_file(const char *filename) {
+    size_t bytes = strlen(uscon_source) + 1 + strlen(filename) + 1;
+    char *path = (char*)malloc(bytes);
+    path[0] = '\0';
+    strcat(path, uscon_source);
+    strcat(path, "/");
+    strcat(path, filename);
+
+    FILE *stream = fopen(path, "r");
+    if (stream == NULL) {
+        perror(path);
+        exit(1);
+    }
+
+    char *title    = NULL;
+    char *bodytext = NULL;
+    if (fscanf(stream, "%m[^\r\n] %m[\x01-\x7F]", &title, &bodytext) != 2) {
+        fprintf(stderr, "Can't extract title/bodytext from '%s'", path);
+        exit(1);
+    }
+
+    Doc *doc = Doc_new(NULL, 0);
+
+    {
+        // Store 'title' field
+        String *field = Str_newf("title");
+        String *value = Str_new_from_utf8(title, strlen(title));
+        Doc_Store(doc, field, (Obj*)value);
+        DECREF(field);
+        DECREF(value);
+    }
+
+    {
+        // Store 'content' field
+        String *field = Str_newf("content");
+        String *value = Str_new_from_utf8(bodytext, strlen(bodytext));
+        Doc_Store(doc, field, (Obj*)value);
+        DECREF(field);
+        DECREF(value);
+    }
+
+    {
+        // Store 'url' field
+        String *field = Str_newf("url");
+        String *value = Str_new_from_utf8(filename, strlen(filename));
+        Doc_Store(doc, field, (Obj*)value);
+        DECREF(field);
+        DECREF(value);
+    }
+
+    fclose(stream);
+    free(bodytext);
+    free(title);
+    free(path);
+    return doc;
+}
+
+int
+main() {
+    // Initialize the library.
+    lucy_bootstrap_parcel();
+
+    String *folder   = Str_newf("%s", path_to_index);
+    String *language = Str_newf("en");
+    Simple *lucy     = Simple_new((Obj*)folder, language);
+
+    DIR *dir = opendir(uscon_source);
+    if (dir == NULL) {
+        perror(uscon_source);
+        return 1;
+    }
+
+    for (struct dirent *entry = readdir(dir);
+         entry;
+         entry = readdir(dir)) {
+
+        if (S_ends_with(entry->d_name, ".txt")) {
+            Doc *doc = S_parse_file(entry->d_name);
+            Simple_Add_Doc(lucy, doc); // ta-da!
+            DECREF(doc);
+        }
+    }
+
+    closedir(dir);
+
+    DECREF(lucy);
+    DECREF(language);
+    DECREF(folder);
+    return 0;
+}
+

http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/c/sample/search.c
----------------------------------------------------------------------
diff --git a/c/sample/search.c b/c/sample/search.c
new file mode 100644
index 0000000..b0c1ffd
--- /dev/null
+++ b/c/sample/search.c
@@ -0,0 +1,127 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#define CFISH_USE_SHORT_NAMES
+#define LUCY_USE_SHORT_NAMES
+#include "Clownfish/String.h"
+#include "Clownfish/Vector.h"
+#include "Lucy/Document/HitDoc.h"
+#include "Lucy/Highlight/Highlighter.h"
+#include "Lucy/Plan/Schema.h"
+#include "Lucy/Search/ANDQuery.h"
+#include "Lucy/Search/Hits.h"
+#include "Lucy/Search/IndexSearcher.h"
+#include "Lucy/Search/TermQuery.h"
+#include "Lucy/Search/QueryParser.h"
+
+const char path_to_index[] = "lucy_index";
+
+static void
+S_usage_and_exit(const char *arg0) {
+    printf("Usage: %s [-c <category>] <querystring>\n", arg0);
+    exit(1);
+}
+
+int
+main(int argc, char *argv[]) {
+    // Initialize the library.
+    lucy_bootstrap_parcel();
+
+    const char *category = NULL;
+    int i = 1;
+
+    while (i < argc - 1) {
+        if (strcmp(argv[i], "-c") == 0) {
+            if (i + 1 >= argc) {
+                S_usage_and_exit(argv[0]);
+            }
+            i += 1;
+            category = argv[i];
+        }
+        else {
+            S_usage_and_exit(argv[0]);
+        }
+
+        i += 1;
+    }
+
+    if (i + 1 != argc) {
+        S_usage_and_exit(argv[0]);
+    }
+
+    const char *query_c = argv[i];
+
+    printf("Searching for: %s\n\n", query_c);
+
+    String        *folder   = Str_newf("%s", path_to_index);
+    IndexSearcher *searcher = IxSearcher_new((Obj*)folder);
+    Schema        *schema   = IxSearcher_Get_Schema(searcher);
+    QueryParser   *qparser  = QParser_new(schema, NULL, NULL, NULL);
+
+    String *query_str = Str_newf("%s", query_c);
+    Query  *query     = QParser_Parse(qparser, query_str);
+
+    String *content_str = Str_newf("content");
+    Highlighter *highlighter
+        = Highlighter_new((Searcher*)searcher, (Obj*)query, content_str, 200);
+
+    if (category) {
+        String *category_name = Str_newf("category");
+        String *category_str  = Str_newf("%s", category);
+        TermQuery *category_query
+            = TermQuery_new(category_name, (Obj*)category_str);
+
+        Vector *children = Vec_new(2);
+        Vec_Push(children, (Obj*)query);
+        Vec_Push(children, (Obj*)category_query);
+        query = (Query*)ANDQuery_new(children);
+
+        DECREF(children);
+        DECREF(category_str);
+        DECREF(category_name);
+    }
+
+    Hits *hits = IxSearcher_Hits(searcher, (Obj*)query, 0, 10, NULL);
+
+    String *title_str = Str_newf("title");
+    String *url_str   = Str_newf("url");
+    HitDoc *hit;
+    i = 1;
+
+    // Loop over search results.
+    while (NULL != (hit = Hits_Next(hits))) {
+        String *title = (String*)HitDoc_Extract(hit, title_str);
+        char *title_c = Str_To_Utf8(title);
+
+        String *url = (String*)HitDoc_Extract(hit, url_str);
+        char *url_c = Str_To_Utf8(url);
+
+        String *excerpt = Highlighter_Create_Excerpt(highlighter, hit);
+        char *excerpt_c = Str_To_Utf8(excerpt);
+
+        printf("Result %d: %s (%s)\n%s\n\n", i, title_c, url_c, excerpt_c);
+
+        free(excerpt_c);
+        free(url_c);
+        free(title_c);
+        DECREF(excerpt);
+        DECREF(url);
+        DECREF(title);
+        DECREF(hit);
+        i++;
+    }
+
+    DECREF(url_str);
+    DECREF(title_str);
+    DECREF(hits);
+    DECREF(query);
+    DECREF(query_str);
+    DECREF(highlighter);
+    DECREF(content_str);
+    DECREF(qparser);
+    DECREF(searcher);
+    DECREF(folder);
+    return 0;
+}
+

http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/c/sample/search_simple.c
----------------------------------------------------------------------
diff --git a/c/sample/search_simple.c b/c/sample/search_simple.c
new file mode 100644
index 0000000..31822e7
--- /dev/null
+++ b/c/sample/search_simple.c
@@ -0,0 +1,70 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#define CFISH_USE_SHORT_NAMES
+#define LUCY_USE_SHORT_NAMES
+#include "Clownfish/String.h"
+#include "Lucy/Document/HitDoc.h"
+#include "Lucy/Simple.h"
+
+const char path_to_index[] = "lucy_index";
+
+static void
+S_usage_and_exit(const char *arg0) {
+    printf("Usage: %s <querystring>\n", arg0);
+    exit(1);
+}
+
+int
+main(int argc, char *argv[]) {
+    // Initialize the library.
+    lucy_bootstrap_parcel();
+
+    if (argc != 2) {
+        S_usage_and_exit(argv[0]);
+    }
+
+    const char *query_c = argv[1];
+
+    printf("Searching for: %s\n\n", query_c);
+
+    String *folder   = Str_newf("%s", path_to_index);
+    String *language = Str_newf("en");
+    Simple *lucy     = Simple_new((Obj*)folder, language);
+
+    String *query_str = Str_newf("%s", query_c);
+    Simple_Search(lucy, query_str, 0, 10);
+
+    String *title_str = Str_newf("title");
+    String *url_str   = Str_newf("url");
+    HitDoc *hit;
+    int i = 1;
+
+    // Loop over search results.
+    while (NULL != (hit = Simple_Next(lucy))) {
+        String *title = (String*)HitDoc_Extract(hit, title_str);
+        char *title_c = Str_To_Utf8(title);
+
+        String *url = (String*)HitDoc_Extract(hit, url_str);
+        char *url_c = Str_To_Utf8(url);
+
+        printf("Result %d: %s (%s)\n", i, title_c, url_c);
+
+        free(url_c);
+        free(title_c);
+        DECREF(url);
+        DECREF(title);
+        DECREF(hit);
+        i++;
+    }
+
+    DECREF(url_str);
+    DECREF(title_str);
+    DECREF(query_str);
+    DECREF(lucy);
+    DECREF(language);
+    DECREF(folder);
+    return 0;
+}
+

http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/common/sample/us_constitution/amend1.txt
----------------------------------------------------------------------
diff --git a/common/sample/us_constitution/amend1.txt b/common/sample/us_constitution/amend1.txt
new file mode 100644
index 0000000..f410f65
--- /dev/null
+++ b/common/sample/us_constitution/amend1.txt
@@ -0,0 +1,7 @@
+Amendment I
+
+Congress shall make no law respecting an establishment of religion, or
+prohibiting the free exercise thereof; or abridging the freedom of speech, or
+of the press; or the right of the people peaceably to assemble, and to
+petition the Government for a redress of grievances.
+

http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/common/sample/us_constitution/amend10.txt
----------------------------------------------------------------------
diff --git a/common/sample/us_constitution/amend10.txt b/common/sample/us_constitution/amend10.txt
new file mode 100644
index 0000000..10fd290
--- /dev/null
+++ b/common/sample/us_constitution/amend10.txt
@@ -0,0 +1,6 @@
+Amendment X
+
+The powers not delegated to the United States by the Constitution, nor
+prohibited by it to the States, are reserved to the States respectively, or
+to the people.
+

http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/common/sample/us_constitution/amend11.txt
----------------------------------------------------------------------
diff --git a/common/sample/us_constitution/amend11.txt b/common/sample/us_constitution/amend11.txt
new file mode 100644
index 0000000..c2a7e3d
--- /dev/null
+++ b/common/sample/us_constitution/amend11.txt
@@ -0,0 +1,7 @@
+Amendment XI
+
+The Judicial power of the United States shall not be construed to extend to
+any suit in law or equity, commenced or prosecuted against one of the United
+States by Citizens of another State, or by Citizens or Subjects of any
+Foreign State.
+

http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/common/sample/us_constitution/amend12.txt
----------------------------------------------------------------------
diff --git a/common/sample/us_constitution/amend12.txt b/common/sample/us_constitution/amend12.txt
new file mode 100644
index 0000000..0906c89
--- /dev/null
+++ b/common/sample/us_constitution/amend12.txt
@@ -0,0 +1,39 @@
+Amendment XII
+
+The Electors shall meet in their respective states, and vote by ballot for
+President and Vice-President, one of whom, at least, shall not be an
+inhabitant of the same state with themselves; they shall name in their
+ballots the person voted for as President, and in distinct ballots the person
+voted for as Vice-President, and they shall make distinct lists of all
+persons voted for as President, and of all persons voted for as
+Vice-President and of the number of votes for each, which lists they shall
+sign and certify, and transmit sealed to the seat of the government of the
+United States, directed to the President of the Senate; 
+
+The President of the Senate shall, in the presence of the Senate and House of
+Representatives, open all the certificates and the votes shall then be
+counted; 
+
+The person having the greatest Number of votes for President, shall be the
+President, if such number be a majority of the whole number of Electors
+appointed; and if no person have such majority, then from the persons having
+the highest numbers not exceeding three on the list of those voted for as
+President, the House of Representatives shall choose immediately, by ballot,
+the President. But in choosing the President, the votes shall be taken by
+states, the representation from each state having one vote; a quorum for this
+purpose shall consist of a member or members from two-thirds of the states,
+and a majority of all the states shall be necessary to a choice. And if the
+House of Representatives shall not choose a President whenever the right of
+choice shall devolve upon them, before the fourth day of March next
+following, then the Vice-President shall act as President, as in the case of
+the death or other constitutional disability of the President. 
+
+The person having the greatest number of votes as Vice-President, shall be
+the Vice-President, if such number be a majority of the whole number of
+Electors appointed, and if no person have a majority, then from the two
+highest numbers on the list, the Senate shall choose the Vice-President; a
+quorum for the purpose shall consist of two-thirds of the whole number of
+Senators, and a majority of the whole number shall be necessary to a choice.
+But no person constitutionally ineligible to the office of President shall be
+eligible to that of Vice-President of the United States.
+

http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/common/sample/us_constitution/amend13.txt
----------------------------------------------------------------------
diff --git a/common/sample/us_constitution/amend13.txt b/common/sample/us_constitution/amend13.txt
new file mode 100644
index 0000000..4a6afd5
--- /dev/null
+++ b/common/sample/us_constitution/amend13.txt
@@ -0,0 +1,9 @@
+Amendment XIII
+
+1. Neither slavery nor involuntary servitude, except as a punishment for
+crime whereof the party shall have been duly convicted, shall exist within
+the United States, or any place subject to their jurisdiction. 
+
+2. Congress shall have power to enforce this article by appropriate
+legislation.
+

http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/common/sample/us_constitution/amend14.txt
----------------------------------------------------------------------
diff --git a/common/sample/us_constitution/amend14.txt b/common/sample/us_constitution/amend14.txt
new file mode 100644
index 0000000..74cb04c
--- /dev/null
+++ b/common/sample/us_constitution/amend14.txt
@@ -0,0 +1,43 @@
+Amendment XIV
+
+1. All persons born or naturalized in the United States, and subject to the
+jurisdiction thereof, are citizens of the United States and of the State
+wherein they reside. No State shall make or enforce any law which shall
+abridge the privileges or immunities of citizens of the United States; nor
+shall any State deprive any person of life, liberty, or property, without due
+process of law; nor deny to any person within its jurisdiction the equal
+protection of the laws. 
+
+2. Representatives shall be apportioned among the several States according to
+their respective numbers, counting the whole number of persons in each State,
+excluding Indians not taxed. But when the right to vote at any election for
+the choice of electors for President and Vice-President of the United States,
+Representatives in Congress, the Executive and Judicial officers of a State,
+or the members of the Legislature thereof, is denied to any of the male
+inhabitants of such State, being twenty-one years of age, and citizens of the
+United States, or in any way abridged, except for participation in rebellion,
+or other crime, the basis of representation therein shall be reduced in the
+proportion which the number of such male citizens shall bear to the whole
+number of male citizens twenty-one years of age in such State. 
+
+3. No person shall be a Senator or Representative in Congress, or elector of
+President and Vice-President, or hold any office, civil or military, under
+the United States, or under any State, who, having previously taken an oath,
+as a member of Congress, or as an officer of the United States, or as a
+member of any State legislature, or as an executive or judicial officer of
+any State, to support the Constitution of the United States, shall have
+engaged in insurrection or rebellion against the same, or given aid or
+comfort to the enemies thereof. But Congress may by a vote of two-thirds of
+each House, remove such disability. 
+
+4. The validity of the public debt of the United States, authorized by law,
+including debts incurred for payment of pensions and bounties for services in
+suppressing insurrection or rebellion, shall not be questioned. But neither
+the United States nor any State shall assume or pay any debt or obligation
+incurred in aid of insurrection or rebellion against the United States, or
+any claim for the loss or emancipation of any slave; but all such debts,
+obligations and claims shall be held illegal and void. 
+
+5. The Congress shall have power to enforce, by appropriate legislation, the
+provisions of this article.
+

http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/common/sample/us_constitution/amend15.txt
----------------------------------------------------------------------
diff --git a/common/sample/us_constitution/amend15.txt b/common/sample/us_constitution/amend15.txt
new file mode 100644
index 0000000..ebe8d81
--- /dev/null
+++ b/common/sample/us_constitution/amend15.txt
@@ -0,0 +1,9 @@
+Amendment XV
+
+1. The right of citizens of the United States to vote shall not be denied or
+abridged by the United States or by any State on account of race, color, or
+previous condition of servitude. 
+
+2. The Congress shall have power to enforce this article by appropriate
+legislation.
+

http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/common/sample/us_constitution/amend16.txt
----------------------------------------------------------------------
diff --git a/common/sample/us_constitution/amend16.txt b/common/sample/us_constitution/amend16.txt
new file mode 100644
index 0000000..ed6087c
--- /dev/null
+++ b/common/sample/us_constitution/amend16.txt
@@ -0,0 +1,6 @@
+Amendment XVI
+
+ The Congress shall have power to lay and collect taxes on incomes, from
+whatever source derived, without apportionment among the several States, and
+without regard to any census or enumeration.
+

http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/common/sample/us_constitution/amend17.txt
----------------------------------------------------------------------
diff --git a/common/sample/us_constitution/amend17.txt b/common/sample/us_constitution/amend17.txt
new file mode 100644
index 0000000..18fbb15
--- /dev/null
+++ b/common/sample/us_constitution/amend17.txt
@@ -0,0 +1,16 @@
+Amendment XVII
+
+The Senate of the United States shall be composed of two Senators from each
+State, elected by the people thereof, for six years; and each Senator shall
+have one vote. The electors in each State shall have the qualifications
+requisite for electors of the most numerous branch of the State legislatures. 
+
+When vacancies happen in the representation of any State in the Senate, the
+executive authority of such State shall issue writs of election to fill such
+vacancies: Provided, That the legislature of any State may empower the
+executive thereof to make temporary appointments until the people fill the
+vacancies by election as the legislature may direct. 
+
+This amendment shall not be so construed as to affect the election or term of
+any Senator chosen before it becomes valid as part of the Constitution.
+

http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/common/sample/us_constitution/amend18.txt
----------------------------------------------------------------------
diff --git a/common/sample/us_constitution/amend18.txt b/common/sample/us_constitution/amend18.txt
new file mode 100644
index 0000000..6e6fab5
--- /dev/null
+++ b/common/sample/us_constitution/amend18.txt
@@ -0,0 +1,16 @@
+Amendment XVIII
+
+1. After one year from the ratification of this article the manufacture,
+sale, or transportation of intoxicating liquors within, the importation
+thereof into, or the exportation thereof from the United States and all
+territory subject to the jurisdiction thereof for beverage purposes is hereby
+prohibited. 
+
+2. The Congress and the several States shall have concurrent power to enforce
+this article by appropriate legislation. 
+
+3. This article shall be inoperative unless it shall have been ratified as an
+amendment to the Constitution by the legislatures of the several States, as
+provided in the Constitution, within seven years from the date of the
+submission hereof to the States by the Congress.
+

http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/common/sample/us_constitution/amend19.txt
----------------------------------------------------------------------
diff --git a/common/sample/us_constitution/amend19.txt b/common/sample/us_constitution/amend19.txt
new file mode 100644
index 0000000..ec3c054
--- /dev/null
+++ b/common/sample/us_constitution/amend19.txt
@@ -0,0 +1,7 @@
+Amendment XIX
+
+The right of citizens of the United States to vote shall not be denied or
+abridged by the United States or by any State on account of sex. 
+
+Congress shall have power to enforce this article by appropriate legislation.
+

http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/common/sample/us_constitution/amend2.txt
----------------------------------------------------------------------
diff --git a/common/sample/us_constitution/amend2.txt b/common/sample/us_constitution/amend2.txt
new file mode 100644
index 0000000..3389890
--- /dev/null
+++ b/common/sample/us_constitution/amend2.txt
@@ -0,0 +1,5 @@
+Amendment II
+
+A well regulated Militia, being necessary to the security of a free State,
+the right of the people to keep and bear Arms, shall not be infringed. 
+

http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/common/sample/us_constitution/amend20.txt
----------------------------------------------------------------------
diff --git a/common/sample/us_constitution/amend20.txt b/common/sample/us_constitution/amend20.txt
new file mode 100644
index 0000000..92eeaa0
--- /dev/null
+++ b/common/sample/us_constitution/amend20.txt
@@ -0,0 +1,36 @@
+Amendment XX
+
+1. The terms of the President and Vice President shall end at noon on the
+20th day of January, and the terms of Senators and Representatives at noon on
+the 3d day of January, of the years in which such terms would have ended if
+this article had not been ratified; and the terms of their successors shall
+then begin. 
+
+2. The Congress shall assemble at least once in every year, and such meeting
+shall begin at noon on the 3d day of January, unless they shall by law
+appoint a different day. 
+
+3. If, at the time fixed for the beginning of the term of the President, the
+President elect shall have died, the Vice President elect shall become
+President. If a President shall not have been chosen before the time fixed
+for the beginning of his term, or if the President elect shall have failed to
+qualify, then the Vice President elect shall act as President until a
+President shall have qualified; and the Congress may by law provide for the
+case wherein neither a President elect nor a Vice President elect shall have
+qualified, declaring who shall then act as President, or the manner in which
+one who is to act shall be selected, and such person shall act accordingly
+until a President or Vice President shall have qualified. 
+
+4. The Congress may by law provide for the case of the death of any of the
+persons from whom the House of Representatives may choose a President
+whenever the right of choice shall have devolved upon them, and for the case
+of the death of any of the persons from whom the Senate may choose a Vice
+President whenever the right of choice shall have devolved upon them. 
+
+5. Sections 1 and 2 shall take effect on the 15th day of October following
+the ratification of this article. 
+
+6. This article shall be inoperative unless it shall have been ratified as an
+amendment to the Constitution by the legislatures of three-fourths of the
+several States within seven years from the date of its submission.
+

http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/common/sample/us_constitution/amend21.txt
----------------------------------------------------------------------
diff --git a/common/sample/us_constitution/amend21.txt b/common/sample/us_constitution/amend21.txt
new file mode 100644
index 0000000..4b36e55
--- /dev/null
+++ b/common/sample/us_constitution/amend21.txt
@@ -0,0 +1,14 @@
+Amendment XXI
+
+1. The eighteenth article of amendment to the Constitution of the United
+States is hereby repealed. 
+
+2. The transportation or importation into any State, Territory, or possession
+of the United States for delivery or use therein of intoxicating liquors, in
+violation of the laws thereof, is hereby prohibited. 
+
+3. The article shall be inoperative unless it shall have been ratified as an
+amendment to the Constitution by conventions in the several States, as
+provided in the Constitution, within seven years from the date of the
+submission hereof to the States by the Congress.
+

http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/common/sample/us_constitution/amend22.txt
----------------------------------------------------------------------
diff --git a/common/sample/us_constitution/amend22.txt b/common/sample/us_constitution/amend22.txt
new file mode 100644
index 0000000..782afa9
--- /dev/null
+++ b/common/sample/us_constitution/amend22.txt
@@ -0,0 +1,17 @@
+Amendment XXII
+
+1. No person shall be elected to the office of the President more than twice,
+and no person who has held the office of President, or acted as President,
+for more than two years of a term to which some other person was elected
+President shall be elected to the office of the President more than once. But
+this Article shall not apply to any person holding the office of President,
+when this Article was proposed by the Congress, and shall not prevent any
+person who may be holding the office of President, or acting as President,
+during the term within which this Article becomes operative from holding the
+office of President or acting as President during the remainder of such term. 
+
+2. This article shall be inoperative unless it shall have been ratified as an
+amendment to the Constitution by the legislatures of three-fourths of the
+several States within seven years from the date of its submission to the
+States by the Congress.
+

http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/common/sample/us_constitution/amend23.txt
----------------------------------------------------------------------
diff --git a/common/sample/us_constitution/amend23.txt b/common/sample/us_constitution/amend23.txt
new file mode 100644
index 0000000..ce2b31d
--- /dev/null
+++ b/common/sample/us_constitution/amend23.txt
@@ -0,0 +1,15 @@
+Amendment XXIII
+
+1. The District constituting the seat of Government of the United States
+shall appoint in such manner as the Congress may direct: A number of electors
+of President and Vice President equal to the whole number of Senators and
+Representatives in Congress to which the District would be entitled if it
+were a State, but in no event more than the least populous State; they shall
+be in addition to those appointed by the States, but they shall be
+considered, for the purposes of the election of President and Vice President,
+to be electors appointed by a State; and they shall meet in the District and
+perform such duties as provided by the twelfth article of amendment. 
+
+2. The Congress shall have power to enforce this article by appropriate
+legislation.
+

http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/common/sample/us_constitution/amend24.txt
----------------------------------------------------------------------
diff --git a/common/sample/us_constitution/amend24.txt b/common/sample/us_constitution/amend24.txt
new file mode 100644
index 0000000..809b582
--- /dev/null
+++ b/common/sample/us_constitution/amend24.txt
@@ -0,0 +1,11 @@
+Amendment XXIV
+
+1. The right of citizens of the United States to vote in any primary or other
+election for President or Vice President, for electors for President or Vice
+President, or for Senator or Representative in Congress, shall not be denied
+or abridged by the United States or any State by reason of failure to pay any
+poll tax or other tax. 
+
+2. The Congress shall have power to enforce this article by appropriate
+legislation.
+

http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/common/sample/us_constitution/amend25.txt
----------------------------------------------------------------------
diff --git a/common/sample/us_constitution/amend25.txt b/common/sample/us_constitution/amend25.txt
new file mode 100644
index 0000000..69b3472
--- /dev/null
+++ b/common/sample/us_constitution/amend25.txt
@@ -0,0 +1,41 @@
+Amendment XXV
+
+1. In case of the removal of the President from office or of his death or
+resignation, the Vice President shall become President. 
+
+2. Whenever there is a vacancy in the office of the Vice President, the
+President shall nominate a Vice President who shall take office upon
+confirmation by a majority vote of both Houses of Congress. 
+
+3. Whenever the President transmits to the President pro tempore of the
+Senate and the Speaker of the House of Representatives his written
+declaration that he is unable to discharge the powers and duties of his
+office, and until he transmits to them a written declaration to the contrary,
+such powers and duties shall be discharged by the Vice President as Acting
+President. 
+
+4. Whenever the Vice President and a majority of either the principal
+officers of the executive departments or of such other body as Congress may
+by law provide, transmit to the President pro tempore of the Senate and the
+Speaker of the House of Representatives their written declaration that the
+President is unable to discharge the powers and duties of his office, the
+Vice President shall immediately assume the powers and duties of the office
+as Acting President. 
+
+Thereafter, when the President transmits to the President pro tempore of the
+Senate and the Speaker of the House of Representatives his written
+declaration that no inability exists, he shall resume the powers and duties
+of his office unless the Vice President and a majority of either the
+principal officers of the executive department or of such other body as
+Congress may by law provide, transmit within four days to the President pro
+tempore of the Senate and the Speaker of the House of Representatives their
+written declaration that the President is unable to discharge the powers and
+duties of his office. Thereupon Congress shall decide the issue, assembling
+within forty eight hours for that purpose if not in session. If the Congress,
+within twenty one days after receipt of the latter written declaration, or,
+if Congress is not in session, within twenty one days after Congress is
+required to assemble, determines by two thirds vote of both Houses that the
+President is unable to discharge the powers and duties of his office, the
+Vice President shall continue to discharge the same as Acting President;
+otherwise, the President shall resume the powers and duties of his office.
+

http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/common/sample/us_constitution/amend26.txt
----------------------------------------------------------------------
diff --git a/common/sample/us_constitution/amend26.txt b/common/sample/us_constitution/amend26.txt
new file mode 100644
index 0000000..2780a76
--- /dev/null
+++ b/common/sample/us_constitution/amend26.txt
@@ -0,0 +1,9 @@
+Amendment XXVI
+
+1. The right of citizens of the United States, who are eighteen years of age
+or older, to vote shall not be denied or abridged by the United States or by
+any State on account of age. 
+
+2. The Congress shall have power to enforce this article by appropriate
+legislation.
+

http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/common/sample/us_constitution/amend27.txt
----------------------------------------------------------------------
diff --git a/common/sample/us_constitution/amend27.txt b/common/sample/us_constitution/amend27.txt
new file mode 100644
index 0000000..6f10920
--- /dev/null
+++ b/common/sample/us_constitution/amend27.txt
@@ -0,0 +1,6 @@
+Amendment XXVII
+
+No law, varying the compensation for the services of the Senators and
+Representatives, shall take effect, until an election of Representatives
+shall have intervened.
+

http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/common/sample/us_constitution/amend3.txt
----------------------------------------------------------------------
diff --git a/common/sample/us_constitution/amend3.txt b/common/sample/us_constitution/amend3.txt
new file mode 100644
index 0000000..edf39e0
--- /dev/null
+++ b/common/sample/us_constitution/amend3.txt
@@ -0,0 +1,6 @@
+Amendment III
+
+No Soldier shall, in time of peace be quartered in any house, without the
+consent of the Owner, nor in time of war, but in a manner to be prescribed by
+law.
+

http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/common/sample/us_constitution/amend4.txt
----------------------------------------------------------------------
diff --git a/common/sample/us_constitution/amend4.txt b/common/sample/us_constitution/amend4.txt
new file mode 100644
index 0000000..eb55b4f
--- /dev/null
+++ b/common/sample/us_constitution/amend4.txt
@@ -0,0 +1,8 @@
+Amendment IV
+
+The right of the people to be secure in their persons, houses, papers, and
+effects, against unreasonable searches and seizures, shall not be violated,
+and no Warrants shall issue, but upon probable cause, supported by Oath or
+affirmation, and particularly describing the place to be searched, and the
+persons or things to be seized.
+

http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/common/sample/us_constitution/amend5.txt
----------------------------------------------------------------------
diff --git a/common/sample/us_constitution/amend5.txt b/common/sample/us_constitution/amend5.txt
new file mode 100644
index 0000000..f975969
--- /dev/null
+++ b/common/sample/us_constitution/amend5.txt
@@ -0,0 +1,11 @@
+Amendment V
+
+No person shall be held to answer for a capital, or otherwise infamous crime,
+unless on a presentment or indictment of a Grand Jury, except in cases
+arising in the land or naval forces, or in the Militia, when in actual
+service in time of War or public danger; nor shall any person be subject for
+the same offense to be twice put in jeopardy of life or limb; nor shall be
+compelled in any criminal case to be a witness against himself, nor be
+deprived of life, liberty, or property, without due process of law; nor shall
+private property be taken for public use, without just compensation.
+

http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/common/sample/us_constitution/amend6.txt
----------------------------------------------------------------------
diff --git a/common/sample/us_constitution/amend6.txt b/common/sample/us_constitution/amend6.txt
new file mode 100644
index 0000000..38ef75f
--- /dev/null
+++ b/common/sample/us_constitution/amend6.txt
@@ -0,0 +1,10 @@
+Amendment VI
+
+In all criminal prosecutions, the accused shall enjoy the right to a speedy
+and public trial, by an impartial jury of the State and district wherein the
+crime shall have been committed, which district shall have been previously
+ascertained by law, and to be informed of the nature and cause of the
+accusation; to be confronted with the witnesses against him; to have
+compulsory process for obtaining witnesses in his favor, and to have the
+Assistance of Counsel for his defence.
+

http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/common/sample/us_constitution/amend7.txt
----------------------------------------------------------------------
diff --git a/common/sample/us_constitution/amend7.txt b/common/sample/us_constitution/amend7.txt
new file mode 100644
index 0000000..f1b9076
--- /dev/null
+++ b/common/sample/us_constitution/amend7.txt
@@ -0,0 +1,7 @@
+Amendment VII
+
+In Suits at common law, where the value in controversy shall exceed twenty
+dollars, the right of trial by jury shall be preserved, and no fact tried by
+a jury, shall be otherwise re-examined in any Court of the United States,
+than according to the rules of the common law.
+

http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/common/sample/us_constitution/amend8.txt
----------------------------------------------------------------------
diff --git a/common/sample/us_constitution/amend8.txt b/common/sample/us_constitution/amend8.txt
new file mode 100644
index 0000000..d2abc91
--- /dev/null
+++ b/common/sample/us_constitution/amend8.txt
@@ -0,0 +1,5 @@
+Amendment VIII
+
+Excessive bail shall not be required, nor excessive fines imposed, nor cruel
+and unusual punishments inflicted.
+

http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/common/sample/us_constitution/amend9.txt
----------------------------------------------------------------------
diff --git a/common/sample/us_constitution/amend9.txt b/common/sample/us_constitution/amend9.txt
new file mode 100644
index 0000000..4315578
--- /dev/null
+++ b/common/sample/us_constitution/amend9.txt
@@ -0,0 +1,5 @@
+Amendment IX
+
+The enumeration in the Constitution, of certain rights, shall not be
+construed to deny or disparage others retained by the people.
+

http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/common/sample/us_constitution/art1sec1.txt
----------------------------------------------------------------------
diff --git a/common/sample/us_constitution/art1sec1.txt b/common/sample/us_constitution/art1sec1.txt
new file mode 100644
index 0000000..81e49fd
--- /dev/null
+++ b/common/sample/us_constitution/art1sec1.txt
@@ -0,0 +1,5 @@
+Article I Section 1
+
+All legislative Powers herein granted shall be vested in a Congress of the
+United States, which shall consist of a Senate and House of Representatives. 
+

http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/common/sample/us_constitution/art1sec10.txt
----------------------------------------------------------------------
diff --git a/common/sample/us_constitution/art1sec10.txt b/common/sample/us_constitution/art1sec10.txt
new file mode 100644
index 0000000..e8362e4
--- /dev/null
+++ b/common/sample/us_constitution/art1sec10.txt
@@ -0,0 +1,20 @@
+Article I Section 10
+
+No State shall enter into any Treaty, Alliance, or Confederation; grant
+Letters of Marque and Reprisal; coin Money; emit Bills of Credit; make any
+Thing but gold and silver Coin a Tender in Payment of Debts; pass any Bill of
+Attainder, ex post facto Law, or Law impairing the Obligation of Contracts,
+or grant any Title of Nobility. 
+
+No State shall, without the Consent of the Congress, lay any Imposts or
+Duties on Imports or Exports, except what may be absolutely necessary for
+executing it's inspection Laws: and the net Produce of all Duties and
+Imposts, laid by any State on Imports or Exports, shall be for the Use of the
+Treasury of the United States; and all such Laws shall be subject to the
+Revision and Controul of the Congress. 
+
+No State shall, without the Consent of Congress, lay any duty of Tonnage,
+keep Troops, or Ships of War in time of Peace, enter into any Agreement or
+Compact with another State, or with a foreign Power, or engage in War, unless
+actually invaded, or in such imminent Danger as will not admit of delay.
+

http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/common/sample/us_constitution/art1sec2.txt
----------------------------------------------------------------------
diff --git a/common/sample/us_constitution/art1sec2.txt b/common/sample/us_constitution/art1sec2.txt
new file mode 100644
index 0000000..d3bf23c
--- /dev/null
+++ b/common/sample/us_constitution/art1sec2.txt
@@ -0,0 +1,35 @@
+Article I Section 2
+
+The House of Representatives shall be composed of Members chosen every second
+Year by the People of the several States, and the Electors in each State
+shall have the Qualifications requisite for Electors of the most numerous
+Branch of the State Legislature. 
+
+No Person shall be a Representative who shall not have attained to the Age of
+twenty five Years, and been seven Years a Citizen of the United States, and
+who shall not, when elected, be an Inhabitant of that State in which he shall
+be chosen. 
+
+Representatives and direct Taxes shall be apportioned among the several
+States which may be included within this Union, according to their respective
+Numbers, which shall be determined by adding to the whole Number of free
+Persons, including those bound to Service for a Term of Years, and excluding
+Indians not taxed, three fifths of all other Persons. 
+
+The actual Enumeration shall be made within three Years after the first
+Meeting of the Congress of the United States, and within every subsequent
+Term of ten Years, in such Manner as they shall by Law direct. The Number of
+Representatives shall not exceed one for every thirty Thousand, but each
+State shall have at Least one Representative; and until such enumeration
+shall be made, the State of New Hampshire shall be entitled to chuse three,
+Massachusetts eight, Rhode Island and Providence Plantations one, Connecticut
+five, New York six, New Jersey four, Pennsylvania eight, Delaware one,
+Maryland six, Virginia ten, North Carolina five, South Carolina five and
+Georgia three. 
+
+When vacancies happen in the Representation from any State, the Executive
+Authority thereof shall issue Writs of Election to fill such Vacancies. 
+
+The House of Representatives shall chuse their Speaker and other Officers;
+and shall have the sole Power of Impeachment. 
+

http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/common/sample/us_constitution/art1sec3.txt
----------------------------------------------------------------------
diff --git a/common/sample/us_constitution/art1sec3.txt b/common/sample/us_constitution/art1sec3.txt
new file mode 100644
index 0000000..3e2f4cc
--- /dev/null
+++ b/common/sample/us_constitution/art1sec3.txt
@@ -0,0 +1,39 @@
+Article I Section 3
+
+The Senate of the United States shall be composed of two Senators from each
+State, chosen by the Legislature thereof, for six Years; and each Senator
+shall have one Vote. 
+
+Immediately after they shall be assembled in Consequence of the first
+Election, they shall be divided as equally as may be into three Classes. The
+Seats of the Senators of the first Class shall be vacated at the Expiration
+of the second Year, of the second Class at the Expiration of the fourth Year,
+and of the third Class at the Expiration of the sixth Year, so that one third
+may be chosen every second Year; and if Vacancies happen by Resignation, or
+otherwise, during the Recess of the Legislature of any State, the Executive
+thereof may make temporary Appointments until the next Meeting of the
+Legislature, which shall then fill such Vacancies. 
+
+No person shall be a Senator who shall not have attained to the Age of thirty
+Years, and been nine Years a Citizen of the United States, and who shall not,
+when elected, be an Inhabitant of that State for which he shall be chosen. 
+
+The Vice President of the United States shall be President of the Senate, but
+shall have no Vote, unless they be equally divided. 
+
+The Senate shall chuse their other Officers, and also a President pro
+tempore, in the absence of the Vice President, or when he shall exercise the
+Office of President of the United States. 
+
+The Senate shall have the sole Power to try all Impeachments. When sitting
+for that Purpose, they shall be on Oath or Affirmation. When the President of
+the United States is tried, the Chief Justice shall preside: And no Person
+shall be convicted without the Concurrence of two thirds of the Members
+present. 
+
+Judgment in Cases of Impeachment shall not extend further than to removal
+from Office, and disqualification to hold and enjoy any Office of honor,
+Trust or Profit under the United States: but the Party convicted shall
+nevertheless be liable and subject to Indictment, Trial, Judgment and
+Punishment, according to Law.
+

http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/common/sample/us_constitution/art1sec4.txt
----------------------------------------------------------------------
diff --git a/common/sample/us_constitution/art1sec4.txt b/common/sample/us_constitution/art1sec4.txt
new file mode 100644
index 0000000..967f7ff
--- /dev/null
+++ b/common/sample/us_constitution/art1sec4.txt
@@ -0,0 +1,11 @@
+Article I Section 4
+
+The Times, Places and Manner of holding Elections for Senators and
+Representatives, shall be prescribed in each State by the Legislature
+thereof; but the Congress may at any time by Law make or alter such
+Regulations, except as to the Place of Chusing Senators. 
+
+The Congress shall assemble at least once in every Year, and such Meeting
+shall be on the first Monday in December, unless they shall by Law appoint a
+different Day.
+

http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/common/sample/us_constitution/art1sec5.txt
----------------------------------------------------------------------
diff --git a/common/sample/us_constitution/art1sec5.txt b/common/sample/us_constitution/art1sec5.txt
new file mode 100644
index 0000000..5190f1e
--- /dev/null
+++ b/common/sample/us_constitution/art1sec5.txt
@@ -0,0 +1,21 @@
+Article I Section 5
+
+Each House shall be the Judge of the Elections, Returns and Qualifications of
+its own Members, and a Majority of each shall constitute a Quorum to do
+Business; but a smaller number may adjourn from day to day, and may be
+authorized to compel the Attendance of absent Members, in such Manner, and
+under such Penalties as each House may provide. 
+
+Each House may determine the Rules of its Proceedings, punish its Members for
+disorderly Behavior, and, with the Concurrence of two-thirds, expel a Member. 
+
+Each House shall keep a Journal of its Proceedings, and from time to time
+publish the same, excepting such Parts as may in their Judgment require
+Secrecy; and the Yeas and Nays of the Members of either House on any question
+shall, at the Desire of one fifth of those Present, be entered on the
+Journal. 
+
+Neither House, during the Session of Congress, shall, without the Consent of
+the other, adjourn for more than three days, nor to any other Place than that
+in which the two Houses shall be sitting.
+

http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/common/sample/us_constitution/art1sec6.txt
----------------------------------------------------------------------
diff --git a/common/sample/us_constitution/art1sec6.txt b/common/sample/us_constitution/art1sec6.txt
new file mode 100644
index 0000000..2351866
--- /dev/null
+++ b/common/sample/us_constitution/art1sec6.txt
@@ -0,0 +1,16 @@
+Article I Section 6
+
+The Senators and Representatives shall receive a Compensation for their
+Services, to be ascertained by Law, and paid out of the Treasury of the
+United States. They shall in all Cases, except Treason, Felony and Breach of
+the Peace, be privileged from Arrest during their Attendance at the Session
+of their respective Houses, and in going to and returning from the same; and
+for any Speech or Debate in either House, they shall not be questioned in any
+other Place. 
+
+No Senator or Representative shall, during the Time for which he was elected,
+be appointed to any civil Office under the Authority of the United States
+which shall have been created, or the Emoluments whereof shall have been
+increased during such time; and no Person holding any Office under the United
+States, shall be a Member of either House during his Continuance in Office.
+

http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/common/sample/us_constitution/art1sec7.txt
----------------------------------------------------------------------
diff --git a/common/sample/us_constitution/art1sec7.txt b/common/sample/us_constitution/art1sec7.txt
new file mode 100644
index 0000000..e7a9444
--- /dev/null
+++ b/common/sample/us_constitution/art1sec7.txt
@@ -0,0 +1,31 @@
+Article I Section 7
+
+All bills for raising Revenue shall originate in the House of
+Representatives; but the Senate may propose or concur with Amendments as on
+other Bills. 
+
+Every Bill which shall have passed the House of Representatives and the
+Senate, shall, before it become a Law, be presented to the President of the
+United States; If he approve he shall sign it, but if not he shall return it,
+with his Objections to that House in which it shall have originated, who
+shall enter the Objections at large on their Journal, and proceed to
+reconsider it. If after such Reconsideration two thirds of that House shall
+agree to pass the Bill, it shall be sent, together with the Objections, to
+the other House, by which it shall likewise be reconsidered, and if approved
+by two thirds of that House, it shall become a Law. But in all such Cases the
+Votes of both Houses shall be determined by Yeas and Nays, and the Names of
+the Persons voting for and against the Bill shall be entered on the Journal
+of each House respectively. If any Bill shall not be returned by the
+President within ten Days (Sundays excepted) after it shall have been
+presented to him, the Same shall be a Law, in like Manner as if he had signed
+it, unless the Congress by their Adjournment prevent its Return, in which
+Case it shall not be a Law. 
+
+Every Order, Resolution, or Vote to which the Concurrence of the Senate and
+House of Representatives may be necessary (except on a question of
+Adjournment) shall be presented to the President of the United States; and
+before the Same shall take Effect, shall be approved by him, or being
+disapproved by him, shall be repassed by two thirds of the Senate and House
+of Representatives, according to the Rules and Limitations prescribed in the
+Case of a Bill.
+

http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/common/sample/us_constitution/art1sec8.txt
----------------------------------------------------------------------
diff --git a/common/sample/us_constitution/art1sec8.txt b/common/sample/us_constitution/art1sec8.txt
new file mode 100644
index 0000000..d8dd374
--- /dev/null
+++ b/common/sample/us_constitution/art1sec8.txt
@@ -0,0 +1,64 @@
+Article I Section 8
+
+The Congress shall have Power To lay and collect Taxes, Duties, Imposts and
+Excises, to pay the Debts and provide for the common Defence and general
+Welfare of the United States; but all Duties, Imposts and Excises shall be
+uniform throughout the United States; 
+
+To borrow money on the credit of the United States; 
+
+To regulate Commerce with foreign Nations, and among the several States, and
+with the Indian Tribes; 
+
+To establish an uniform Rule of Naturalization, and uniform Laws on the
+subject of Bankruptcies throughout the United States; 
+
+To coin Money, regulate the Value thereof, and of foreign Coin, and fix the
+Standard of Weights and Measures; 
+
+To provide for the Punishment of counterfeiting the Securities and current
+Coin of the United States; 
+
+To establish Post Offices and Post Roads; 
+
+To promote the Progress of Science and useful Arts, by securing for limited
+Times to Authors and Inventors the exclusive Right to their respective
+Writings and Discoveries; 
+
+To constitute Tribunals inferior to the supreme Court; 
+
+To define and punish Piracies and Felonies committed on the high Seas, and
+Offenses against the Law of Nations; 
+
+To declare War, grant Letters of Marque and Reprisal, and make Rules
+concerning Captures on Land and Water; 
+
+To raise and support Armies, but no Appropriation of Money to that Use shall
+be for a longer Term than two Years; 
+
+To provide and maintain a Navy; 
+
+To make Rules for the Government and Regulation of the land and naval Forces; 
+
+To provide for calling forth the Militia to execute the Laws of the Union,
+suppress Insurrections and repel Invasions; 
+
+To provide for organizing, arming, and disciplining the Militia, and for
+governing such Part of them as may be employed in the Service of the United
+States, reserving to the States respectively, the Appointment of the
+Officers, and the Authority of training the Militia according to the
+discipline prescribed by Congress; 
+
+To exercise exclusive Legislation in all Cases whatsoever, over such District
+(not exceeding ten Miles square) as may, by Cession of particular States, and
+the acceptance of Congress, become the Seat of the Government of the United
+States, and to exercise like Authority over all Places purchased by the
+Consent of the Legislature of the State in which the Same shall be, for the
+Erection of Forts, Magazines, Arsenals, dock-Yards, and other needful
+Buildings; And 
+
+To make all Laws which shall be necessary and proper for carrying into
+Execution the foregoing Powers, and all other Powers vested by this
+Constitution in the Government of the United States, or in any Department or
+Officer thereof. 
+

http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/common/sample/us_constitution/art1sec9.txt
----------------------------------------------------------------------
diff --git a/common/sample/us_constitution/art1sec9.txt b/common/sample/us_constitution/art1sec9.txt
new file mode 100644
index 0000000..029cbb8
--- /dev/null
+++ b/common/sample/us_constitution/art1sec9.txt
@@ -0,0 +1,30 @@
+Article I Section 9
+
+The Migration or Importation of such Persons as any of the States now
+existing shall think proper to admit, shall not be prohibited by the Congress
+prior to the Year one thousand eight hundred and eight, but a tax or duty may
+be imposed on such Importation, not exceeding ten dollars for each Person. 
+
+The privilege of the Writ of Habeas Corpus shall not be suspended, unless
+when in Cases of Rebellion or Invasion the public Safety may require it. 
+
+No Bill of Attainder or ex post facto Law shall be passed. No capitation, or
+other direct, Tax shall be laid, unless in Proportion to the Census or
+Enumeration herein before directed to be taken. 
+
+No Tax or Duty shall be laid on Articles exported from any State. 
+
+No Preference shall be given by any Regulation of Commerce or Revenue to the
+Ports of one State over those of another: nor shall Vessels bound to, or
+from, one State, be obliged to enter, clear, or pay Duties in another. 
+
+No Money shall be drawn from the Treasury, but in Consequence of
+Appropriations made by Law; and a regular Statement and Account of the
+Receipts and Expenditures of all public Money shall be published from time to
+time. 
+
+No Title of Nobility shall be granted by the United States: And no Person
+holding any Office of Profit or Trust under them, shall, without the Consent
+of the Congress, accept of any present, Emolument, Office, or Title, of any
+kind whatever, from any King, Prince or foreign State.
+

http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/common/sample/us_constitution/art2sec1.txt
----------------------------------------------------------------------
diff --git a/common/sample/us_constitution/art2sec1.txt b/common/sample/us_constitution/art2sec1.txt
new file mode 100644
index 0000000..66ee6ad
--- /dev/null
+++ b/common/sample/us_constitution/art2sec1.txt
@@ -0,0 +1,65 @@
+Article II Section 1
+
+The executive Power shall be vested in a President of the United States of
+America. He shall hold his Office during the Term of four Years, and,
+together with the Vice-President chosen for the same Term, be elected, as
+follows: 
+
+Each State shall appoint, in such Manner as the Legislature thereof may
+direct, a Number of Electors, equal to the whole Number of Senators and
+Representatives to which the State may be entitled in the Congress: but no
+Senator or Representative, or Person holding an Office of Trust or Profit
+under the United States, shall be appointed an Elector. 
+
+The Electors shall meet in their respective States, and vote by Ballot for
+two persons, of whom one at least shall not lie an Inhabitant of the same
+State with themselves. And they shall make a List of all the Persons voted
+for, and of the Number of Votes for each; which List they shall sign and
+certify, and transmit sealed to the Seat of the Government of the United
+States, directed to the President of the Senate. The President of the Senate
+shall, in the Presence of the Senate and House of Representatives, open all
+the Certificates, and the Votes shall then be counted. The Person having the
+greatest Number of Votes shall be the President, if such Number be a Majority
+of the whole Number of Electors appointed; and if there be more than one who
+have such Majority, and have an equal Number of Votes, then the House of
+Representatives shall immediately chuse by Ballot one of them for President;
+and if no Person have a Majority, then from the five highest on the List the
+said House shall in like Manner chuse the President. But in chusing the
+President, the Votes shall be taken by States, the Representation from each
+State having one Vote; a quorum for this Purpose shall consist of a Member or
+Members from two-thirds of the States, and a Majority of all the States shall
+be necessary to a Choice. In every Case, after the Choice of the President,
+the Person having the greatest Number of Votes of the Electors shall be the
+Vice President. But if there should remain two or more who have equal Votes,
+the Senate shall chuse from them by Ballot the Vice-President. 
+
+The Congress may determine the Time of chusing the Electors, and the Day on
+which they shall give their Votes; which Day shall be the same throughout the
+United States. 
+
+No person except a natural born Citizen, or a Citizen of the United States,
+at the time of the Adoption of this Constitution, shall be eligible to the
+Office of President; neither shall any Person be eligible to that Office who
+shall not have attained to the Age of thirty-five Years, and been fourteen
+Years a Resident within the United States. 
+
+In Case of the Removal of the President from Office, or of his Death,
+Resignation, or Inability to discharge the Powers and Duties of the said
+Office, the same shall devolve on the Vice President, and the Congress may by
+Law provide for the Case of Removal, Death, Resignation or Inability, both of
+the President and Vice President, declaring what Officer shall then act as
+President, and such Officer shall act accordingly, until the Disability be
+removed, or a President shall be elected. 
+
+The President shall, at stated Times, receive for his Services, a
+Compensation, which shall neither be increased nor diminished during the
+Period for which he shall have been elected, and he shall not receive within
+that Period any other Emolument from the United States, or any of them. 
+
+Before he enter on the Execution of his Office, he shall take the following
+Oath or Affirmation: 
+
+"I do solemnly swear (or affirm) that I will faithfully execute the Office of
+President of the United States, and will to the best of my Ability, preserve,
+protect and defend the Constitution of the United States." 
+

http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/common/sample/us_constitution/art2sec2.txt
----------------------------------------------------------------------
diff --git a/common/sample/us_constitution/art2sec2.txt b/common/sample/us_constitution/art2sec2.txt
new file mode 100644
index 0000000..753a370
--- /dev/null
+++ b/common/sample/us_constitution/art2sec2.txt
@@ -0,0 +1,24 @@
+Article II Section 2
+
+The President shall be Commander in Chief of the Army and Navy of the United
+States, and of the Militia of the several States, when called into the actual
+Service of the United States; he may require the Opinion, in writing, of the
+principal Officer in each of the executive Departments, upon any subject
+relating to the Duties of their respective Offices, and he shall have Power
+to Grant Reprieves and Pardons for Offenses against the United States, except
+in Cases of Impeachment. 
+
+He shall have Power, by and with the Advice and Consent of the Senate, to
+make Treaties, provided two thirds of the Senators present concur; and he
+shall nominate, and by and with the Advice and Consent of the Senate, shall
+appoint Ambassadors, other public Ministers and Consuls, Judges of the
+supreme Court, and all other Officers of the United States, whose
+Appointments are not herein otherwise provided for, and which shall be
+established by Law: but the Congress may by Law vest the Appointment of such
+inferior Officers, as they think proper, in the President alone, in the
+Courts of Law, or in the Heads of Departments. 
+
+The President shall have Power to fill up all Vacancies that may happen
+during the Recess of the Senate, by granting Commissions which shall expire
+at the End of their next Session.
+

http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/common/sample/us_constitution/art2sec3.txt
----------------------------------------------------------------------
diff --git a/common/sample/us_constitution/art2sec3.txt b/common/sample/us_constitution/art2sec3.txt
new file mode 100644
index 0000000..c951a85
--- /dev/null
+++ b/common/sample/us_constitution/art2sec3.txt
@@ -0,0 +1,11 @@
+Article II Section 3
+
+He shall from time to time give to the Congress Information of the State of
+the Union, and recommend to their Consideration such Measures as he shall
+judge necessary and expedient; he may, on extraordinary Occasions, convene
+both Houses, or either of them, and in Case of Disagreement between them,
+with Respect to the Time of Adjournment, he may adjourn them to such Time as
+he shall think proper; he shall receive Ambassadors and other public
+Ministers; he shall take Care that the Laws be faithfully executed, and shall
+Commission all the Officers of the United States.
+

http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/common/sample/us_constitution/art2sec4.txt
----------------------------------------------------------------------
diff --git a/common/sample/us_constitution/art2sec4.txt b/common/sample/us_constitution/art2sec4.txt
new file mode 100644
index 0000000..60f947f
--- /dev/null
+++ b/common/sample/us_constitution/art2sec4.txt
@@ -0,0 +1,6 @@
+Article II Section 4
+
+The President, Vice President and all civil Officers of the United States,
+shall be removed from Office on Impeachment for, and Conviction of, Treason,
+Bribery, or other high Crimes and Misdemeanors.
+

http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/common/sample/us_constitution/art3sec1.txt
----------------------------------------------------------------------
diff --git a/common/sample/us_constitution/art3sec1.txt b/common/sample/us_constitution/art3sec1.txt
new file mode 100644
index 0000000..dead4fa
--- /dev/null
+++ b/common/sample/us_constitution/art3sec1.txt
@@ -0,0 +1,9 @@
+Article III Section 1
+
+The judicial Power of the United States, shall be vested in one supreme
+Court, and in such inferior Courts as the Congress may from time to time
+ordain and establish. The Judges, both of the supreme and inferior Courts,
+shall hold their Offices during good Behavior, and shall, at stated Times,
+receive for their Services a Compensation which shall not be diminished
+during their Continuance in Office.
+

http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/common/sample/us_constitution/art3sec2.txt
----------------------------------------------------------------------
diff --git a/common/sample/us_constitution/art3sec2.txt b/common/sample/us_constitution/art3sec2.txt
new file mode 100644
index 0000000..3f4f942
--- /dev/null
+++ b/common/sample/us_constitution/art3sec2.txt
@@ -0,0 +1,24 @@
+Article III Section 2
+
+The judicial Power shall extend to all Cases, in Law and Equity, arising
+under this Constitution, the Laws of the United States, and Treaties made, or
+which shall be made, under their Authority; to all Cases affecting
+Ambassadors, other public Ministers and Consuls; to all Cases of admiralty
+and maritime Jurisdiction; to Controversies to which the United States shall
+be a Party; to Controversies between two or more States; between a State and
+Citizens of another State; between Citizens of different States; between
+Citizens of the same State claiming Lands under Grants of different States,
+and between a State, or the Citizens thereof, and foreign States, Citizens or
+Subjects. 
+
+In all Cases affecting Ambassadors, other public Ministers and Consuls, and
+those in which a State shall be Party, the supreme Court shall have original
+Jurisdiction. In all the other Cases before mentioned, the supreme Court
+shall have appellate Jurisdiction, both as to Law and Fact, with such
+Exceptions, and under such Regulations as the Congress shall make. 
+
+Trial of all Crimes, except in Cases of Impeachment, shall be by Jury; and
+such Trial shall be held in the State where the said Crimes shall have been
+committed; but when not committed within any State, the Trial shall be at
+such Place or Places as the Congress may by Law have directed.
+

http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/common/sample/us_constitution/art3sec3.txt
----------------------------------------------------------------------
diff --git a/common/sample/us_constitution/art3sec3.txt b/common/sample/us_constitution/art3sec3.txt
new file mode 100644
index 0000000..2625150
--- /dev/null
+++ b/common/sample/us_constitution/art3sec3.txt
@@ -0,0 +1,11 @@
+Article III Section 3
+
+Treason against the United States, shall consist only in levying War against
+them, or in adhering to their Enemies, giving them Aid and Comfort. No Person
+shall be convicted of Treason unless on the Testimony of two Witnesses to the
+same overt Act, or on Confession in open Court. 
+
+The Congress shall have power to declare the Punishment of Treason, but no
+Attainder of Treason shall work Corruption of Blood, or Forfeiture except
+during the Life of the Person attainted. 
+

http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/common/sample/us_constitution/art4sec1.txt
----------------------------------------------------------------------
diff --git a/common/sample/us_constitution/art4sec1.txt b/common/sample/us_constitution/art4sec1.txt
new file mode 100644
index 0000000..f50c27c
--- /dev/null
+++ b/common/sample/us_constitution/art4sec1.txt
@@ -0,0 +1,7 @@
+Article IV Section 1
+
+Full Faith and Credit shall be given in each State to the public Acts,
+Records, and judicial Proceedings of every other State. And the Congress may
+by general Laws prescribe the Manner in which such Acts, Records and
+Proceedings shall be proved, and the Effect thereof. 
+

http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/common/sample/us_constitution/art4sec2.txt
----------------------------------------------------------------------
diff --git a/common/sample/us_constitution/art4sec2.txt b/common/sample/us_constitution/art4sec2.txt
new file mode 100644
index 0000000..00af0da
--- /dev/null
+++ b/common/sample/us_constitution/art4sec2.txt
@@ -0,0 +1,15 @@
+Article IV Section 2
+
+The Citizens of each State shall be entitled to all Privileges and Immunities
+of Citizens in the several States. 
+
+A Person charged in any State with Treason, Felony, or other Crime, who shall
+flee from Justice, and be found in another State, shall on demand of the
+executive Authority of the State from which he fled, be delivered up, to be
+removed to the State having Jurisdiction of the Crime. 
+
+No Person held to Service or Labour in one State, under the Laws thereof,
+escaping into another, shall, in Consequence of any Law or Regulation
+therein, be discharged from such Service or Labour, But shall be delivered up
+on Claim of the Party to whom such Service or Labour may be due.
+

http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/common/sample/us_constitution/art4sec3.txt
----------------------------------------------------------------------
diff --git a/common/sample/us_constitution/art4sec3.txt b/common/sample/us_constitution/art4sec3.txt
new file mode 100644
index 0000000..0c5bf9d
--- /dev/null
+++ b/common/sample/us_constitution/art4sec3.txt
@@ -0,0 +1,13 @@
+Article IV Section 3
+
+New States may be admitted by the Congress into this Union; but no new States
+shall be formed or erected within the Jurisdiction of any other State; nor
+any State be formed by the Junction of two or more States, or parts of
+States, without the Consent of the Legislatures of the States concerned as
+well as of the Congress. 
+
+The Congress shall have Power to dispose of and make all needful Rules and
+Regulations respecting the Territory or other Property belonging to the
+United States; and nothing in this Constitution shall be so construed as to
+Prejudice any Claims of the United States, or of any particular State.
+

http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/common/sample/us_constitution/art4sec4.txt
----------------------------------------------------------------------
diff --git a/common/sample/us_constitution/art4sec4.txt b/common/sample/us_constitution/art4sec4.txt
new file mode 100644
index 0000000..bd06b25
--- /dev/null
+++ b/common/sample/us_constitution/art4sec4.txt
@@ -0,0 +1,7 @@
+Article IV Section 4
+
+The United States shall guarantee to every State in this Union a Republican
+Form of Government, and shall protect each of them against Invasion; and on
+Application of the Legislature, or of the Executive (when the Legislature
+cannot be convened) against domestic Violence. 
+

http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/common/sample/us_constitution/art5.txt
----------------------------------------------------------------------
diff --git a/common/sample/us_constitution/art5.txt b/common/sample/us_constitution/art5.txt
new file mode 100644
index 0000000..66cc4aa
--- /dev/null
+++ b/common/sample/us_constitution/art5.txt
@@ -0,0 +1,14 @@
+Article V 
+
+The Congress, whenever two thirds of both Houses shall deem it necessary,
+shall propose Amendments to this Constitution, or, on the Application of the
+Legislatures of two thirds of the several States, shall call a Convention for
+proposing Amendments, which, in either Case, shall be valid to all Intents
+and Purposes, as part of this Constitution, when ratified by the Legislatures
+of three fourths of the several States, or by Conventions in three fourths
+thereof, as the one or the other Mode of Ratification may be proposed by the
+Congress; Provided that no Amendment which may be made prior to the Year One
+thousand eight hundred and eight shall in any Manner affect the first and
+fourth Clauses in the Ninth Section of the first Article; and that no State,
+without its Consent, shall be deprived of its equal Suffrage in the Senate.
+

http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/common/sample/us_constitution/art6.txt
----------------------------------------------------------------------
diff --git a/common/sample/us_constitution/art6.txt b/common/sample/us_constitution/art6.txt
new file mode 100644
index 0000000..463674a
--- /dev/null
+++ b/common/sample/us_constitution/art6.txt
@@ -0,0 +1,19 @@
+Article VI 
+
+All Debts contracted and Engagements entered into, before the Adoption of
+this Constitution, shall be as valid against the United States under this
+Constitution, as under the Confederation. 
+
+This Constitution, and the Laws of the United States which shall be made in
+Pursuance thereof; and all Treaties made, or which shall be made, under the
+Authority of the United States, shall be the supreme Law of the Land; and the
+Judges in every State shall be bound thereby, any Thing in the Constitution
+or Laws of any State to the Contrary notwithstanding. 
+
+The Senators and Representatives before mentioned, and the Members of the
+several State Legislatures, and all executive and judicial Officers, both of
+the United States and of the several States, shall be bound by Oath or
+Affirmation, to support this Constitution; but no religious Test shall ever
+be required as a Qualification to any Office or public Trust under the United
+States.
+

http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/common/sample/us_constitution/art7.txt
----------------------------------------------------------------------
diff --git a/common/sample/us_constitution/art7.txt b/common/sample/us_constitution/art7.txt
new file mode 100644
index 0000000..1f53ef3
--- /dev/null
+++ b/common/sample/us_constitution/art7.txt
@@ -0,0 +1,43 @@
+Article VII 
+
+The Ratification of the Conventions of nine States, shall be sufficient for
+the Establishment of this Constitution between the States so ratifying the
+Same. 
+
+Done in Convention by the Unanimous Consent of the States present the
+Seventeenth Day of September in the Year of our Lord one thousand seven
+hundred and Eighty seven and of the Independence of the United States of
+America the Twelfth. In Witness whereof We have hereunto subscribed our
+Names. 
+
+Go Washington - President and deputy from Virginia 
+
+New Hampshire - John Langdon, Nicholas Gilman 
+
+Massachusetts - Nathaniel Gorham, Rufus King 
+
+Connecticut - Wm Saml Johnson, Roger Sherman 
+
+New York - Alexander Hamilton 
+
+New Jersey - Wil Livingston, David Brearley, Wm Paterson, Jona. Dayton 
+
+Pensylvania - B Franklin, Thomas Mifflin, Robt Morris, Geo. Clymer, Thos
+FitzSimons, Jared Ingersoll, James Wilson, Gouv Morris 
+
+Delaware - Geo. Read, Gunning Bedford jun, John Dickinson, Richard Bassett,
+Jaco. Broom 
+
+Maryland - James McHenry, Dan of St Tho Jenifer, Danl Carroll 
+
+Virginia - John Blair, James Madison Jr. 
+
+North Carolina - Wm Blount, Richd Dobbs Spaight, Hu Williamson 
+
+South Carolina - J. Rutledge, Charles Cotesworth Pinckney, Charles Pinckney,
+Pierce Butler 
+
+Georgia - William Few, Abr Baldwin 
+
+Attest: William Jackson, Secretary 
+


[3/6] lucy git commit: C code examples for tutorial

Posted by nw...@apache.org.
http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/perl/sample/us_constitution/art1sec9.txt
----------------------------------------------------------------------
diff --git a/perl/sample/us_constitution/art1sec9.txt b/perl/sample/us_constitution/art1sec9.txt
deleted file mode 100644
index 029cbb8..0000000
--- a/perl/sample/us_constitution/art1sec9.txt
+++ /dev/null
@@ -1,30 +0,0 @@
-Article I Section 9
-
-The Migration or Importation of such Persons as any of the States now
-existing shall think proper to admit, shall not be prohibited by the Congress
-prior to the Year one thousand eight hundred and eight, but a tax or duty may
-be imposed on such Importation, not exceeding ten dollars for each Person. 
-
-The privilege of the Writ of Habeas Corpus shall not be suspended, unless
-when in Cases of Rebellion or Invasion the public Safety may require it. 
-
-No Bill of Attainder or ex post facto Law shall be passed. No capitation, or
-other direct, Tax shall be laid, unless in Proportion to the Census or
-Enumeration herein before directed to be taken. 
-
-No Tax or Duty shall be laid on Articles exported from any State. 
-
-No Preference shall be given by any Regulation of Commerce or Revenue to the
-Ports of one State over those of another: nor shall Vessels bound to, or
-from, one State, be obliged to enter, clear, or pay Duties in another. 
-
-No Money shall be drawn from the Treasury, but in Consequence of
-Appropriations made by Law; and a regular Statement and Account of the
-Receipts and Expenditures of all public Money shall be published from time to
-time. 
-
-No Title of Nobility shall be granted by the United States: And no Person
-holding any Office of Profit or Trust under them, shall, without the Consent
-of the Congress, accept of any present, Emolument, Office, or Title, of any
-kind whatever, from any King, Prince or foreign State.
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/perl/sample/us_constitution/art2sec1.txt
----------------------------------------------------------------------
diff --git a/perl/sample/us_constitution/art2sec1.txt b/perl/sample/us_constitution/art2sec1.txt
deleted file mode 100644
index 66ee6ad..0000000
--- a/perl/sample/us_constitution/art2sec1.txt
+++ /dev/null
@@ -1,65 +0,0 @@
-Article II Section 1
-
-The executive Power shall be vested in a President of the United States of
-America. He shall hold his Office during the Term of four Years, and,
-together with the Vice-President chosen for the same Term, be elected, as
-follows: 
-
-Each State shall appoint, in such Manner as the Legislature thereof may
-direct, a Number of Electors, equal to the whole Number of Senators and
-Representatives to which the State may be entitled in the Congress: but no
-Senator or Representative, or Person holding an Office of Trust or Profit
-under the United States, shall be appointed an Elector. 
-
-The Electors shall meet in their respective States, and vote by Ballot for
-two persons, of whom one at least shall not lie an Inhabitant of the same
-State with themselves. And they shall make a List of all the Persons voted
-for, and of the Number of Votes for each; which List they shall sign and
-certify, and transmit sealed to the Seat of the Government of the United
-States, directed to the President of the Senate. The President of the Senate
-shall, in the Presence of the Senate and House of Representatives, open all
-the Certificates, and the Votes shall then be counted. The Person having the
-greatest Number of Votes shall be the President, if such Number be a Majority
-of the whole Number of Electors appointed; and if there be more than one who
-have such Majority, and have an equal Number of Votes, then the House of
-Representatives shall immediately chuse by Ballot one of them for President;
-and if no Person have a Majority, then from the five highest on the List the
-said House shall in like Manner chuse the President. But in chusing the
-President, the Votes shall be taken by States, the Representation from each
-State having one Vote; a quorum for this Purpose shall consist of a Member or
-Members from two-thirds of the States, and a Majority of all the States shall
-be necessary to a Choice. In every Case, after the Choice of the President,
-the Person having the greatest Number of Votes of the Electors shall be the
-Vice President. But if there should remain two or more who have equal Votes,
-the Senate shall chuse from them by Ballot the Vice-President. 
-
-The Congress may determine the Time of chusing the Electors, and the Day on
-which they shall give their Votes; which Day shall be the same throughout the
-United States. 
-
-No person except a natural born Citizen, or a Citizen of the United States,
-at the time of the Adoption of this Constitution, shall be eligible to the
-Office of President; neither shall any Person be eligible to that Office who
-shall not have attained to the Age of thirty-five Years, and been fourteen
-Years a Resident within the United States. 
-
-In Case of the Removal of the President from Office, or of his Death,
-Resignation, or Inability to discharge the Powers and Duties of the said
-Office, the same shall devolve on the Vice President, and the Congress may by
-Law provide for the Case of Removal, Death, Resignation or Inability, both of
-the President and Vice President, declaring what Officer shall then act as
-President, and such Officer shall act accordingly, until the Disability be
-removed, or a President shall be elected. 
-
-The President shall, at stated Times, receive for his Services, a
-Compensation, which shall neither be increased nor diminished during the
-Period for which he shall have been elected, and he shall not receive within
-that Period any other Emolument from the United States, or any of them. 
-
-Before he enter on the Execution of his Office, he shall take the following
-Oath or Affirmation: 
-
-"I do solemnly swear (or affirm) that I will faithfully execute the Office of
-President of the United States, and will to the best of my Ability, preserve,
-protect and defend the Constitution of the United States." 
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/perl/sample/us_constitution/art2sec2.txt
----------------------------------------------------------------------
diff --git a/perl/sample/us_constitution/art2sec2.txt b/perl/sample/us_constitution/art2sec2.txt
deleted file mode 100644
index 753a370..0000000
--- a/perl/sample/us_constitution/art2sec2.txt
+++ /dev/null
@@ -1,24 +0,0 @@
-Article II Section 2
-
-The President shall be Commander in Chief of the Army and Navy of the United
-States, and of the Militia of the several States, when called into the actual
-Service of the United States; he may require the Opinion, in writing, of the
-principal Officer in each of the executive Departments, upon any subject
-relating to the Duties of their respective Offices, and he shall have Power
-to Grant Reprieves and Pardons for Offenses against the United States, except
-in Cases of Impeachment. 
-
-He shall have Power, by and with the Advice and Consent of the Senate, to
-make Treaties, provided two thirds of the Senators present concur; and he
-shall nominate, and by and with the Advice and Consent of the Senate, shall
-appoint Ambassadors, other public Ministers and Consuls, Judges of the
-supreme Court, and all other Officers of the United States, whose
-Appointments are not herein otherwise provided for, and which shall be
-established by Law: but the Congress may by Law vest the Appointment of such
-inferior Officers, as they think proper, in the President alone, in the
-Courts of Law, or in the Heads of Departments. 
-
-The President shall have Power to fill up all Vacancies that may happen
-during the Recess of the Senate, by granting Commissions which shall expire
-at the End of their next Session.
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/perl/sample/us_constitution/art2sec3.txt
----------------------------------------------------------------------
diff --git a/perl/sample/us_constitution/art2sec3.txt b/perl/sample/us_constitution/art2sec3.txt
deleted file mode 100644
index c951a85..0000000
--- a/perl/sample/us_constitution/art2sec3.txt
+++ /dev/null
@@ -1,11 +0,0 @@
-Article II Section 3
-
-He shall from time to time give to the Congress Information of the State of
-the Union, and recommend to their Consideration such Measures as he shall
-judge necessary and expedient; he may, on extraordinary Occasions, convene
-both Houses, or either of them, and in Case of Disagreement between them,
-with Respect to the Time of Adjournment, he may adjourn them to such Time as
-he shall think proper; he shall receive Ambassadors and other public
-Ministers; he shall take Care that the Laws be faithfully executed, and shall
-Commission all the Officers of the United States.
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/perl/sample/us_constitution/art2sec4.txt
----------------------------------------------------------------------
diff --git a/perl/sample/us_constitution/art2sec4.txt b/perl/sample/us_constitution/art2sec4.txt
deleted file mode 100644
index 60f947f..0000000
--- a/perl/sample/us_constitution/art2sec4.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-Article II Section 4
-
-The President, Vice President and all civil Officers of the United States,
-shall be removed from Office on Impeachment for, and Conviction of, Treason,
-Bribery, or other high Crimes and Misdemeanors.
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/perl/sample/us_constitution/art3sec1.txt
----------------------------------------------------------------------
diff --git a/perl/sample/us_constitution/art3sec1.txt b/perl/sample/us_constitution/art3sec1.txt
deleted file mode 100644
index dead4fa..0000000
--- a/perl/sample/us_constitution/art3sec1.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-Article III Section 1
-
-The judicial Power of the United States, shall be vested in one supreme
-Court, and in such inferior Courts as the Congress may from time to time
-ordain and establish. The Judges, both of the supreme and inferior Courts,
-shall hold their Offices during good Behavior, and shall, at stated Times,
-receive for their Services a Compensation which shall not be diminished
-during their Continuance in Office.
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/perl/sample/us_constitution/art3sec2.txt
----------------------------------------------------------------------
diff --git a/perl/sample/us_constitution/art3sec2.txt b/perl/sample/us_constitution/art3sec2.txt
deleted file mode 100644
index 3f4f942..0000000
--- a/perl/sample/us_constitution/art3sec2.txt
+++ /dev/null
@@ -1,24 +0,0 @@
-Article III Section 2
-
-The judicial Power shall extend to all Cases, in Law and Equity, arising
-under this Constitution, the Laws of the United States, and Treaties made, or
-which shall be made, under their Authority; to all Cases affecting
-Ambassadors, other public Ministers and Consuls; to all Cases of admiralty
-and maritime Jurisdiction; to Controversies to which the United States shall
-be a Party; to Controversies between two or more States; between a State and
-Citizens of another State; between Citizens of different States; between
-Citizens of the same State claiming Lands under Grants of different States,
-and between a State, or the Citizens thereof, and foreign States, Citizens or
-Subjects. 
-
-In all Cases affecting Ambassadors, other public Ministers and Consuls, and
-those in which a State shall be Party, the supreme Court shall have original
-Jurisdiction. In all the other Cases before mentioned, the supreme Court
-shall have appellate Jurisdiction, both as to Law and Fact, with such
-Exceptions, and under such Regulations as the Congress shall make. 
-
-Trial of all Crimes, except in Cases of Impeachment, shall be by Jury; and
-such Trial shall be held in the State where the said Crimes shall have been
-committed; but when not committed within any State, the Trial shall be at
-such Place or Places as the Congress may by Law have directed.
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/perl/sample/us_constitution/art3sec3.txt
----------------------------------------------------------------------
diff --git a/perl/sample/us_constitution/art3sec3.txt b/perl/sample/us_constitution/art3sec3.txt
deleted file mode 100644
index 2625150..0000000
--- a/perl/sample/us_constitution/art3sec3.txt
+++ /dev/null
@@ -1,11 +0,0 @@
-Article III Section 3
-
-Treason against the United States, shall consist only in levying War against
-them, or in adhering to their Enemies, giving them Aid and Comfort. No Person
-shall be convicted of Treason unless on the Testimony of two Witnesses to the
-same overt Act, or on Confession in open Court. 
-
-The Congress shall have power to declare the Punishment of Treason, but no
-Attainder of Treason shall work Corruption of Blood, or Forfeiture except
-during the Life of the Person attainted. 
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/perl/sample/us_constitution/art4sec1.txt
----------------------------------------------------------------------
diff --git a/perl/sample/us_constitution/art4sec1.txt b/perl/sample/us_constitution/art4sec1.txt
deleted file mode 100644
index f50c27c..0000000
--- a/perl/sample/us_constitution/art4sec1.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-Article IV Section 1
-
-Full Faith and Credit shall be given in each State to the public Acts,
-Records, and judicial Proceedings of every other State. And the Congress may
-by general Laws prescribe the Manner in which such Acts, Records and
-Proceedings shall be proved, and the Effect thereof. 
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/perl/sample/us_constitution/art4sec2.txt
----------------------------------------------------------------------
diff --git a/perl/sample/us_constitution/art4sec2.txt b/perl/sample/us_constitution/art4sec2.txt
deleted file mode 100644
index 00af0da..0000000
--- a/perl/sample/us_constitution/art4sec2.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-Article IV Section 2
-
-The Citizens of each State shall be entitled to all Privileges and Immunities
-of Citizens in the several States. 
-
-A Person charged in any State with Treason, Felony, or other Crime, who shall
-flee from Justice, and be found in another State, shall on demand of the
-executive Authority of the State from which he fled, be delivered up, to be
-removed to the State having Jurisdiction of the Crime. 
-
-No Person held to Service or Labour in one State, under the Laws thereof,
-escaping into another, shall, in Consequence of any Law or Regulation
-therein, be discharged from such Service or Labour, But shall be delivered up
-on Claim of the Party to whom such Service or Labour may be due.
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/perl/sample/us_constitution/art4sec3.txt
----------------------------------------------------------------------
diff --git a/perl/sample/us_constitution/art4sec3.txt b/perl/sample/us_constitution/art4sec3.txt
deleted file mode 100644
index 0c5bf9d..0000000
--- a/perl/sample/us_constitution/art4sec3.txt
+++ /dev/null
@@ -1,13 +0,0 @@
-Article IV Section 3
-
-New States may be admitted by the Congress into this Union; but no new States
-shall be formed or erected within the Jurisdiction of any other State; nor
-any State be formed by the Junction of two or more States, or parts of
-States, without the Consent of the Legislatures of the States concerned as
-well as of the Congress. 
-
-The Congress shall have Power to dispose of and make all needful Rules and
-Regulations respecting the Territory or other Property belonging to the
-United States; and nothing in this Constitution shall be so construed as to
-Prejudice any Claims of the United States, or of any particular State.
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/perl/sample/us_constitution/art4sec4.txt
----------------------------------------------------------------------
diff --git a/perl/sample/us_constitution/art4sec4.txt b/perl/sample/us_constitution/art4sec4.txt
deleted file mode 100644
index bd06b25..0000000
--- a/perl/sample/us_constitution/art4sec4.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-Article IV Section 4
-
-The United States shall guarantee to every State in this Union a Republican
-Form of Government, and shall protect each of them against Invasion; and on
-Application of the Legislature, or of the Executive (when the Legislature
-cannot be convened) against domestic Violence. 
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/perl/sample/us_constitution/art5.txt
----------------------------------------------------------------------
diff --git a/perl/sample/us_constitution/art5.txt b/perl/sample/us_constitution/art5.txt
deleted file mode 100644
index 66cc4aa..0000000
--- a/perl/sample/us_constitution/art5.txt
+++ /dev/null
@@ -1,14 +0,0 @@
-Article V 
-
-The Congress, whenever two thirds of both Houses shall deem it necessary,
-shall propose Amendments to this Constitution, or, on the Application of the
-Legislatures of two thirds of the several States, shall call a Convention for
-proposing Amendments, which, in either Case, shall be valid to all Intents
-and Purposes, as part of this Constitution, when ratified by the Legislatures
-of three fourths of the several States, or by Conventions in three fourths
-thereof, as the one or the other Mode of Ratification may be proposed by the
-Congress; Provided that no Amendment which may be made prior to the Year One
-thousand eight hundred and eight shall in any Manner affect the first and
-fourth Clauses in the Ninth Section of the first Article; and that no State,
-without its Consent, shall be deprived of its equal Suffrage in the Senate.
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/perl/sample/us_constitution/art6.txt
----------------------------------------------------------------------
diff --git a/perl/sample/us_constitution/art6.txt b/perl/sample/us_constitution/art6.txt
deleted file mode 100644
index 463674a..0000000
--- a/perl/sample/us_constitution/art6.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-Article VI 
-
-All Debts contracted and Engagements entered into, before the Adoption of
-this Constitution, shall be as valid against the United States under this
-Constitution, as under the Confederation. 
-
-This Constitution, and the Laws of the United States which shall be made in
-Pursuance thereof; and all Treaties made, or which shall be made, under the
-Authority of the United States, shall be the supreme Law of the Land; and the
-Judges in every State shall be bound thereby, any Thing in the Constitution
-or Laws of any State to the Contrary notwithstanding. 
-
-The Senators and Representatives before mentioned, and the Members of the
-several State Legislatures, and all executive and judicial Officers, both of
-the United States and of the several States, shall be bound by Oath or
-Affirmation, to support this Constitution; but no religious Test shall ever
-be required as a Qualification to any Office or public Trust under the United
-States.
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/perl/sample/us_constitution/art7.txt
----------------------------------------------------------------------
diff --git a/perl/sample/us_constitution/art7.txt b/perl/sample/us_constitution/art7.txt
deleted file mode 100644
index 1f53ef3..0000000
--- a/perl/sample/us_constitution/art7.txt
+++ /dev/null
@@ -1,43 +0,0 @@
-Article VII 
-
-The Ratification of the Conventions of nine States, shall be sufficient for
-the Establishment of this Constitution between the States so ratifying the
-Same. 
-
-Done in Convention by the Unanimous Consent of the States present the
-Seventeenth Day of September in the Year of our Lord one thousand seven
-hundred and Eighty seven and of the Independence of the United States of
-America the Twelfth. In Witness whereof We have hereunto subscribed our
-Names. 
-
-Go Washington - President and deputy from Virginia 
-
-New Hampshire - John Langdon, Nicholas Gilman 
-
-Massachusetts - Nathaniel Gorham, Rufus King 
-
-Connecticut - Wm Saml Johnson, Roger Sherman 
-
-New York - Alexander Hamilton 
-
-New Jersey - Wil Livingston, David Brearley, Wm Paterson, Jona. Dayton 
-
-Pensylvania - B Franklin, Thomas Mifflin, Robt Morris, Geo. Clymer, Thos
-FitzSimons, Jared Ingersoll, James Wilson, Gouv Morris 
-
-Delaware - Geo. Read, Gunning Bedford jun, John Dickinson, Richard Bassett,
-Jaco. Broom 
-
-Maryland - James McHenry, Dan of St Tho Jenifer, Danl Carroll 
-
-Virginia - John Blair, James Madison Jr. 
-
-North Carolina - Wm Blount, Richd Dobbs Spaight, Hu Williamson 
-
-South Carolina - J. Rutledge, Charles Cotesworth Pinckney, Charles Pinckney,
-Pierce Butler 
-
-Georgia - William Few, Abr Baldwin 
-
-Attest: William Jackson, Secretary 
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/perl/sample/us_constitution/index.html
----------------------------------------------------------------------
diff --git a/perl/sample/us_constitution/index.html b/perl/sample/us_constitution/index.html
deleted file mode 100644
index 16948b0..0000000
--- a/perl/sample/us_constitution/index.html
+++ /dev/null
@@ -1,114 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-
-<html>
-
-  <head>
-    <meta http-equiv="content-type" content="text/html;charset=UTF-8">
-    <link rel="stylesheet" type="text/css" href="uscon.css">
-    <title>US Constitution</title>
-    <!--
-      Licensed to the Apache Software Foundation (ASF) under one or more
-      contributor license agreements.  See the NOTICE file distributed with
-      this work for additional information regarding copyright ownership.
-      The ASF licenses this file to You under the Apache License, Version 2.0
-      (the "License"); you may not use this file except in compliance with
-      the License.  You may obtain a copy of the License at
-      
-        http://www.apache.org/licenses/LICENSE-2.0
-      
-      Unless required by applicable law or agreed to in writing, software
-      distributed under the License is distributed on an "AS IS" BASIS,
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-      See the License for the specific language governing permissions and
-      limitations under the License.
-    -->
-  </head>
-
-  <body>
-    <div id="navigation">
-       US Constitution
-    </div><!--navigation-->
-
-    <div id="bodytext">
-    <ul>
-      <li><a href="preamble.txt">Preamble</a></li>
-
-      <li><a name="articles"></a>Article I</li>
-        <ul>
-          <li><a href="art1sec1.txt">Article I Section 1</a></li>
-          <li><a href="art1sec2.txt">Article I Section 2</a></li>
-          <li><a href="art1sec3.txt">Article I Section 3</a></li>
-          <li><a href="art1sec4.txt">Article I Section 4</a></li>
-          <li><a href="art1sec5.txt">Article I Section 5</a></li>
-          <li><a href="art1sec6.txt">Article I Section 6</a></li>
-          <li><a href="art1sec7.txt">Article I Section 7</a></li>
-          <li><a href="art1sec8.txt">Article I Section 8</a></li>
-          <li><a href="art1sec9.txt">Article I Section 9</a></li>
-          <li><a href="art1sec10.txt">Article I Section 10</a></li>
-        </ul>
-    
-      <li>Article II</li>
-        <ul>
-          <li><a href="art2sec1.txt">Article II Section 1</a></li>
-          <li><a href="art2sec2.txt">Article II Section 2</a></li>
-          <li><a href="art2sec3.txt">Article II Section 3</a></li>
-          <li><a href="art2sec4.txt">Article II Section 4</a></li>
-        </ul>
-        
-      <li>Article III</li>
-        <ul>
-          <li><a href="art3sec1.txt">Article III Section 1</a></li>
-          <li><a href="art3sec2.txt">Article III Section 2</a></li>
-          <li><a href="art3sec3.txt">Article III Section 3</a></li>
-        </ul>
-        
-      <li>Article IV</li>
-        <ul>
-          <li><a href="art4sec1.txt">Article IV Section 1</a></li>
-          <li><a href="art4sec2.txt">Article IV Section 2</a></li>
-          <li><a href="art4sec3.txt">Article IV Section 3</a></li>
-          <li><a href="art4sec4.txt">Article IV Section 4</a></li>
-        </ul>
-    
-      <li><a href="art5.txt">Article V</a></li>
-    
-      <li><a href="art6.txt">Article VI</a></li>
-    
-      <li><a href="art7.txt">Article VII</a></li>
-    
-      <li><a name="amendments"></a>Amendments</li>
-        <ul>
-          <li><a href="amend1.txt">Amendment 1</a></li>
-          <li><a href="amend2.txt">Amendment 2</a></li>
-          <li><a href="amend3.txt">Amendment 3</a></li>
-          <li><a href="amend4.txt">Amendment 4</a></li>
-          <li><a href="amend5.txt">Amendment 5</a></li>
-          <li><a href="amend6.txt">Amendment 6</a></li>
-          <li><a href="amend7.txt">Amendment 7</a></li>
-          <li><a href="amend8.txt">Amendment 8</a></li>
-          <li><a href="amend9.txt">Amendment 9</a></li>
-          <li><a href="amend10.txt">Amendment 10</a></li>
-          <li><a href="amend11.txt">Amendment 11</a></li>
-          <li><a href="amend12.txt">Amendment 12</a></li>
-          <li><a href="amend13.txt">Amendment 13</a></li>
-          <li><a href="amend14.txt">Amendment 14</a></li>
-          <li><a href="amend15.txt">Amendment 15</a></li>
-          <li><a href="amend16.txt">Amendment 16</a></li>
-          <li><a href="amend17.txt">Amendment 17</a></li>
-          <li><a href="amend18.txt">Amendment 18</a></li>
-          <li><a href="amend19.txt">Amendment 19</a></li>
-          <li><a href="amend20.txt">Amendment 20</a></li>
-          <li><a href="amend21.txt">Amendment 21</a></li>
-          <li><a href="amend22.txt">Amendment 22</a></li>
-          <li><a href="amend23.txt">Amendment 23</a></li>
-          <li><a href="amend24.txt">Amendment 24</a></li>
-          <li><a href="amend25.txt">Amendment 25</a></li>
-          <li><a href="amend26.txt">Amendment 26</a></li>
-          <li><a href="amend27.txt">Amendment 27</a></li>
-        </ul>
-    </ul>
-  </div><!--bodytext-->
-  </body>
-
-</html>
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/perl/sample/us_constitution/preamble.txt
----------------------------------------------------------------------
diff --git a/perl/sample/us_constitution/preamble.txt b/perl/sample/us_constitution/preamble.txt
deleted file mode 100644
index ee1bffe..0000000
--- a/perl/sample/us_constitution/preamble.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-Preamble
-
-We the People of the United States, in Order to form a more perfect Union,
-establish Justice, insure domestic Tranquility, provide for the common
-defence, promote the general Welfare, and secure the Blessings of Liberty to
-ourselves and our Posterity, do ordain and establish this Constitution for
-the United States of America. 
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/perl/sample/us_constitution/uscon.css
----------------------------------------------------------------------
diff --git a/perl/sample/us_constitution/uscon.css b/perl/sample/us_constitution/uscon.css
deleted file mode 100644
index c674edd..0000000
--- a/perl/sample/us_constitution/uscon.css
+++ /dev/null
@@ -1,45 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-body,table,textarea {
-    font-family: Arial, Helvetica, sans-serif;
-}
-
-body {
-    font-size: 90%; 
-    background: #fff;
-    margin: 0 0 0 0;
-}
-
-div#navigation {
-    background: #ddfff6;
-    padding: 10px;
-    border-bottom: 1px solid #555;
-}
-
-div#bodytext {
-    margin: 10px 10px 10px 10px;
-}
-
-form#usconSearch {
-    display: inline;
-    margin-bottom: 0px;
-}
-
-span.excerptURL {
-    color: green;
-}
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/dcc62153/perl/t/binding/702-sample.t
----------------------------------------------------------------------
diff --git a/perl/t/binding/702-sample.t b/perl/t/binding/702-sample.t
index eafbc54..ccfb012 100644
--- a/perl/t/binding/702-sample.t
+++ b/perl/t/binding/702-sample.t
@@ -29,6 +29,7 @@ BEGIN {
 }
 use File::Spec::Functions qw( catfile catdir );
 use File::Path qw( rmtree );
+use Lucy::Test::TestUtils qw( uscon_dir );
 
 my $search_cgi_orig_path = catfile(qw( sample search.cgi ));
 my $indexer_pl_orig_path = catfile(qw( sample indexer.pl ));
@@ -47,7 +48,7 @@ for my $filename (qw( search.cgi indexer.pl )) {
     close $fh or die "Close failed: $!";
     $content =~ s/(path_to_index\s+=\s+).*?;/$1'_sample_index';/
         or die "no match";
-    my $uscon_source = catdir(qw( sample us_constitution ));
+    my $uscon_source = uscon_dir();
     $content =~ s/(uscon_source\s+=\s+).*?;/$1'$uscon_source';/;
     $content =~ s/(^use warnings;\n)/$1no warnings 'deprecated';\n/m;
     $content =~ s/^use/$use_dirs;\nuse/m;