From 4d6e33205a36b7c4ad0175674eccf0561202d8fd Mon Sep 17 00:00:00 2001 From: Nick Wellnhofer Date: Sun, 7 Feb 2016 14:29:54 +0100 Subject: [PATCH 1/6] Document all public constructors and initializers CFC now uses the constructor documentation for Perl POD. Make the constructor public if the initializer is public. Add hand-rolled POD for abstract constructors. --- core/Lucy/Analysis/Analyzer.cfh | 2 + core/Lucy/Analysis/CaseFolder.cfh | 6 +- core/Lucy/Analysis/EasyAnalyzer.cfh | 9 ++- core/Lucy/Analysis/Inversion.cfh | 3 +- core/Lucy/Analysis/Normalizer.cfh | 12 +++- core/Lucy/Analysis/PolyAnalyzer.cfh | 16 ++++- core/Lucy/Analysis/RegexTokenizer.cfh | 12 +++- core/Lucy/Analysis/SnowballStemmer.cfh | 10 ++- core/Lucy/Analysis/SnowballStopFilter.cfh | 10 ++- core/Lucy/Analysis/StandardTokenizer.cfh | 6 +- core/Lucy/Analysis/Token.cfh | 14 +++- core/Lucy/Document/Doc.cfh | 11 ++- core/Lucy/Highlight/Highlighter.cfh | 16 ++++- core/Lucy/Index/BackgroundMerger.cfh | 8 ++- core/Lucy/Index/DataReader.cfh | 3 +- core/Lucy/Index/DataWriter.cfh | 3 +- core/Lucy/Index/IndexManager.cfh | 8 ++- core/Lucy/Index/IndexReader.cfh | 14 +++- core/Lucy/Index/Indexer.cfh | 9 ++- core/Lucy/Index/Lexicon.cfh | 2 + core/Lucy/Index/PolyReader.cfh | 15 +++- core/Lucy/Index/Posting.cfh | 2 + core/Lucy/Index/PostingList.cfh | 2 + core/Lucy/Index/Segment.cfh | 6 +- core/Lucy/Index/Similarity.cfh | 6 +- core/Lucy/Index/Snapshot.cfh | 5 +- core/Lucy/Index/SortCache.cfh | 2 + core/Lucy/Index/TermStepper.cfh | 2 + core/Lucy/Object/BitVector.cfh | 10 ++- core/Lucy/Plan/Architecture.cfh | 4 +- core/Lucy/Plan/BlobType.cfh | 13 ++-- core/Lucy/Plan/FullTextType.cfh | 16 +++-- core/Lucy/Plan/NumericType.cfh | 18 +++++ core/Lucy/Plan/Schema.cfh | 4 +- core/Lucy/Plan/StringType.cfh | 16 +++-- core/Lucy/Search/ANDQuery.cfh | 9 ++- core/Lucy/Search/Collector.cfh | 9 ++- core/Lucy/Search/Compiler.cfh | 2 +- core/Lucy/Search/IndexSearcher.cfh | 9 ++- core/Lucy/Search/LeafQuery.cfh | 10 ++- core/Lucy/Search/MatchAllQuery.cfh | 6 +- core/Lucy/Search/Matcher.cfh | 2 +- core/Lucy/Search/NOTQuery.cfh | 10 +-- core/Lucy/Search/NoMatchQuery.cfh | 6 +- core/Lucy/Search/ORQuery.cfh | 9 ++- core/Lucy/Search/PhraseQuery.cfh | 10 ++- core/Lucy/Search/PolyQuery.cfh | 3 +- core/Lucy/Search/PolySearcher.cfh | 10 ++- core/Lucy/Search/Query.cfh | 2 +- core/Lucy/Search/QueryParser.cfh | 20 +++++- core/Lucy/Search/RangeQuery.cfh | 18 +++-- core/Lucy/Search/RequiredOptionalQuery.cfh | 10 ++- core/Lucy/Search/Searcher.cfh | 2 +- core/Lucy/Search/SortRule.cfh | 14 ++-- core/Lucy/Search/SortSpec.cfh | 7 +- core/Lucy/Search/Span.cfh | 12 ++-- core/Lucy/Search/TermQuery.cfh | 10 ++- core/Lucy/Simple.cfh | 2 + core/Lucy/Store/FSFolder.cfh | 12 ++-- core/Lucy/Store/Folder.cfh | 2 + core/Lucy/Store/Lock.cfh | 2 +- core/Lucy/Store/LockFactory.cfh | 10 ++- core/Lucy/Store/RAMFolder.cfh | 9 ++- core/LucyX/Search/ProximityQuery.cfh | 10 ++- perl/buildlib/Lucy/Build/Binding/Index.pm | 59 ++++++++++++++- perl/buildlib/Lucy/Build/Binding/Plan.pm | 12 +++- perl/buildlib/Lucy/Build/Binding/Search.pm | 83 +++++++++++++++++++--- perl/buildlib/Lucy/Build/Binding/Store.pm | 32 ++++++++- 68 files changed, 585 insertions(+), 133 deletions(-) diff --git a/core/Lucy/Analysis/Analyzer.cfh b/core/Lucy/Analysis/Analyzer.cfh index cc1363a2f..80215292b 100644 --- a/core/Lucy/Analysis/Analyzer.cfh +++ b/core/Lucy/Analysis/Analyzer.cfh @@ -26,6 +26,8 @@ parcel Lucy; */ public abstract class Lucy::Analysis::Analyzer inherits Clownfish::Obj { + /** Abstract initializer. + */ public inert Analyzer* init(Analyzer *self); diff --git a/core/Lucy/Analysis/CaseFolder.cfh b/core/Lucy/Analysis/CaseFolder.cfh index 5c7dcbacb..4b6fe2b78 100644 --- a/core/Lucy/Analysis/CaseFolder.cfh +++ b/core/Lucy/Analysis/CaseFolder.cfh @@ -29,10 +29,12 @@ public class Lucy::Analysis::CaseFolder inherits Lucy::Analysis::Analyzer { Normalizer *normalizer; - inert incremented CaseFolder* + /** Constructor. Takes no arguments. + */ + public inert incremented CaseFolder* new(); - /** Constructor. Takes no arguments. + /** Initialize a CaseFolder. */ public inert CaseFolder* init(CaseFolder *self); diff --git a/core/Lucy/Analysis/EasyAnalyzer.cfh b/core/Lucy/Analysis/EasyAnalyzer.cfh index 3d1ac88e0..95ad32e9a 100644 --- a/core/Lucy/Analysis/EasyAnalyzer.cfh +++ b/core/Lucy/Analysis/EasyAnalyzer.cfh @@ -48,10 +48,15 @@ public class Lucy::Analysis::EasyAnalyzer inherits Lucy::Analysis::Analyzer { Normalizer *normalizer; SnowballStemmer *stemmer; - inert incremented EasyAnalyzer* + /** Create a new EasyAnalyzer. + * + * @param language An ISO code from the list of supported languages. + */ + public inert incremented EasyAnalyzer* new(String *language = NULL); - /** + /** Initialize an EasyAnalyzer. + * * @param language An ISO code from the list of supported languages. */ public inert EasyAnalyzer* diff --git a/core/Lucy/Analysis/Inversion.cfh b/core/Lucy/Analysis/Inversion.cfh index 750c2ddd7..507aa04af 100644 --- a/core/Lucy/Analysis/Inversion.cfh +++ b/core/Lucy/Analysis/Inversion.cfh @@ -32,7 +32,8 @@ public class Lucy::Analysis::Inversion inherits Clownfish::Obj { uint32_t *cluster_counts; /* counts per unique text */ uint32_t cluster_counts_size; /* num unique texts */ - /** + /** Create a new Inversion. + * * @param seed An initial Token to start things off, which may be * [](@null). */ diff --git a/core/Lucy/Analysis/Normalizer.cfh b/core/Lucy/Analysis/Normalizer.cfh index 39ec3764c..c589e6867 100644 --- a/core/Lucy/Analysis/Normalizer.cfh +++ b/core/Lucy/Analysis/Normalizer.cfh @@ -31,11 +31,19 @@ public class Lucy::Analysis::Normalizer inherits Lucy::Analysis::Analyzer { int options; - inert incremented Normalizer* + /** Create a new Normalizer. + * + * @param normalization_form Unicode normalization form, can be one of + * 'NFC', 'NFKC', 'NFD', 'NFKD'. Defaults to 'NFKC'. + * @param case_fold Perform case folding, default is true. + * @param strip_accents Strip accents, default is false. + */ + public inert incremented Normalizer* new(String *normalization_form = NULL, bool case_fold = true, bool strip_accents = false); - /** + /** Initialize a Normalizer. + * * @param normalization_form Unicode normalization form, can be one of * 'NFC', 'NFKC', 'NFD', 'NFKD'. Defaults to 'NFKC'. * @param case_fold Perform case folding, default is true. diff --git a/core/Lucy/Analysis/PolyAnalyzer.cfh b/core/Lucy/Analysis/PolyAnalyzer.cfh index 0a7badb78..59025b5a8 100644 --- a/core/Lucy/Analysis/PolyAnalyzer.cfh +++ b/core/Lucy/Analysis/PolyAnalyzer.cfh @@ -51,10 +51,22 @@ public class Lucy::Analysis::PolyAnalyzer inherits Lucy::Analysis::Analyzer { Vector *analyzers; - inert incremented PolyAnalyzer* + /** Create a new PolyAnalyzer. + * + * @param language An ISO code from the list of supported languages. + * DEPRECATED, use [](cfish:EasyAnalyzer) instead. + * @param analyzers An array of Analyzers. The order of the analyzers + * matters. Don't put a SnowballStemmer before a RegexTokenizer (can't stem whole + * documents or paragraphs -- just individual words), or a SnowballStopFilter + * after a SnowballStemmer (stemmed words, e.g. "themselv", will not appear in a + * stoplist). In general, the sequence should be: tokenize, normalize, + * stopalize, stem. + */ + public inert incremented PolyAnalyzer* new(String *language = NULL, Vector *analyzers = NULL); - /** + /** Initialize a PolyAnalyzer. + * * @param language An ISO code from the list of supported languages. * DEPRECATED, use [](cfish:EasyAnalyzer) instead. * @param analyzers An array of Analyzers. The order of the analyzers diff --git a/core/Lucy/Analysis/RegexTokenizer.cfh b/core/Lucy/Analysis/RegexTokenizer.cfh index ec14d51e8..9b986fae1 100644 --- a/core/Lucy/Analysis/RegexTokenizer.cfh +++ b/core/Lucy/Analysis/RegexTokenizer.cfh @@ -59,10 +59,18 @@ public class Lucy::Analysis::RegexTokenizer inert bool is_available(); - inert incremented RegexTokenizer* + /** Create a new RegexTokenizer. + * + * @param pattern A string specifying a Perl-syntax regular expression + * which should match one token. The default value is + * `\w+(?:[\x{2019}']\w+)*`, which matches "it's" as well as + * "it" and "O'Henry's" as well as "Henry". + */ + public inert incremented RegexTokenizer* new(String *pattern = NULL); - /** + /** Initilaize a RegexTokenizer. + * * @param pattern A string specifying a Perl-syntax regular expression * which should match one token. The default value is * `\w+(?:[\x{2019}']\w+)*`, which matches "it's" as well as diff --git a/core/Lucy/Analysis/SnowballStemmer.cfh b/core/Lucy/Analysis/SnowballStemmer.cfh index 0777eac42..d292048ca 100644 --- a/core/Lucy/Analysis/SnowballStemmer.cfh +++ b/core/Lucy/Analysis/SnowballStemmer.cfh @@ -31,10 +31,16 @@ public class Lucy::Analysis::SnowballStemmer nickname SnowStemmer void *snowstemmer; String *language; - inert incremented SnowballStemmer* + /** Create a new SnowballStemmer. + * + * @param language A two-letter ISO code identifying a language supported + * by Snowball. + */ + public inert incremented SnowballStemmer* new(String *language); - /** + /** Initialize a SnowballStemmer. + * * @param language A two-letter ISO code identifying a language supported * by Snowball. */ diff --git a/core/Lucy/Analysis/SnowballStopFilter.cfh b/core/Lucy/Analysis/SnowballStopFilter.cfh index d2c16ce7e..82edc6589 100644 --- a/core/Lucy/Analysis/SnowballStopFilter.cfh +++ b/core/Lucy/Analysis/SnowballStopFilter.cfh @@ -73,10 +73,16 @@ public class Lucy::Analysis::SnowballStopFilter nickname SnowStop inert const uint8_t** snow_ru; inert const uint8_t** snow_sv; - inert incremented SnowballStopFilter* + /** Create a new SnowballStopFilter. + * + * @param stoplist A hash with stopwords as the keys. + * @param language The ISO code for a supported language. + */ + public inert incremented SnowballStopFilter* new(String *language = NULL, Hash *stoplist = NULL); - /** + /** Initialize a SnowballStopFilter. + * * @param stoplist A hash with stopwords as the keys. * @param language The ISO code for a supported language. */ diff --git a/core/Lucy/Analysis/StandardTokenizer.cfh b/core/Lucy/Analysis/StandardTokenizer.cfh index 211309f80..52b9a07a3 100644 --- a/core/Lucy/Analysis/StandardTokenizer.cfh +++ b/core/Lucy/Analysis/StandardTokenizer.cfh @@ -29,10 +29,12 @@ parcel Lucy; public class Lucy::Analysis::StandardTokenizer inherits Lucy::Analysis::Analyzer { - inert incremented StandardTokenizer* + /** Constructor. Takes no arguments. + */ + public inert incremented StandardTokenizer* new(); - /** Constructor. Takes no arguments. + /** Initialize a StandardTokenizer. */ public inert StandardTokenizer* init(StandardTokenizer *self); diff --git a/core/Lucy/Analysis/Token.cfh b/core/Lucy/Analysis/Token.cfh index 81e187a55..6910a1aa0 100644 --- a/core/Lucy/Analysis/Token.cfh +++ b/core/Lucy/Analysis/Token.cfh @@ -58,11 +58,23 @@ public class Lucy::Analysis::Token inherits Clownfish::Obj { int32_t pos_inc; int32_t pos; + /** Create a new Token. + * + * @param text A UTF-8 string. + * @param len Size of the string in bytes. + * @param start_offset Start offset into the original document in Unicode + * code points. + * @param start_offset End offset into the original document in Unicode + * code points. + * @param boost Per-token weight. + * @param pos_inc Position increment for phrase matching. + */ public inert incremented Token* new(const char *text, size_t len, uint32_t start_offset, uint32_t end_offset, float boost = 1.0, int32_t pos_inc = 1); - /** + /** Initialize a Token. + * * @param text A UTF-8 string. * @param len Size of the string in bytes. * @param start_offset Start offset into the original document in Unicode diff --git a/core/Lucy/Document/Doc.cfh b/core/Lucy/Document/Doc.cfh index 4db55d621..c06d07108 100644 --- a/core/Lucy/Document/Doc.cfh +++ b/core/Lucy/Document/Doc.cfh @@ -27,10 +27,17 @@ public class Lucy::Document::Doc inherits Clownfish::Obj { void *fields; int32_t doc_id; - inert incremented Doc* + /** Create a new Document. + * + * @param fields Field-value pairs. + * @param doc_id Internal Lucy document id. Default of 0 (an + * invalid doc id). + */ + public inert incremented Doc* new(void *fields = NULL, int32_t doc_id = 0); - /** + /** Initialize a Document. + * * @param fields Field-value pairs. * @param doc_id Internal Lucy document id. Default of 0 (an * invalid doc id). diff --git a/core/Lucy/Highlight/Highlighter.cfh b/core/Lucy/Highlight/Highlighter.cfh index d1a80a9d2..f31337cc8 100644 --- a/core/Lucy/Highlight/Highlighter.cfh +++ b/core/Lucy/Highlight/Highlighter.cfh @@ -34,11 +34,23 @@ public class Lucy::Highlight::Highlighter inherits Clownfish::Obj { String *post_tag; Compiler *compiler; - inert incremented Highlighter* + /** Create a new Highlighter. + * + * @param searcher An object which inherits from + * [](cfish:Searcher), such as an + * [](cfish:IndexSearcher). + * @param query Query object or a query string. + * @param field The name of the field from which to draw the excerpt. The + * field must marked as be `highlightable` (see + * [](cfish:FieldType)). + * @param excerpt_length Maximum length of the excerpt, in characters. + */ + public inert incremented Highlighter* new(Searcher *searcher, Obj *query, String *field, uint32_t excerpt_length = 200); - /** + /** Initialize a Highlighter. + * * @param searcher An object which inherits from * [](cfish:Searcher), such as an * [](cfish:IndexSearcher). diff --git a/core/Lucy/Index/BackgroundMerger.cfh b/core/Lucy/Index/BackgroundMerger.cfh index 8d60c8bb8..1639b4d78 100644 --- a/core/Lucy/Index/BackgroundMerger.cfh +++ b/core/Lucy/Index/BackgroundMerger.cfh @@ -47,10 +47,16 @@ public class Lucy::Index::BackgroundMerger nickname BGMerger bool needs_commit; bool prepared; + /** Open a new BackgroundMerger. + * + * @param index Either a string filepath or a Folder. + * @param manager An IndexManager. If not supplied, an IndexManager with + * a 10-second write lock timeout will be created. + */ public inert incremented BackgroundMerger* new(Obj *index, IndexManager *manager = NULL); - /** Open a new BackgroundMerger. + /** Initialize a BackgroundMerger. * * @param index Either a string filepath or a Folder. * @param manager An IndexManager. If not supplied, an IndexManager with diff --git a/core/Lucy/Index/DataReader.cfh b/core/Lucy/Index/DataReader.cfh index ce40f0461..ee3cf6a3e 100644 --- a/core/Lucy/Index/DataReader.cfh +++ b/core/Lucy/Index/DataReader.cfh @@ -32,7 +32,8 @@ public class Lucy::Index::DataReader inherits Clownfish::Obj { Segment *segment; int32_t seg_tick; - /** + /** Abstract initializer. + * * @param schema A Schema. * @param folder A Folder. * @param snapshot A Snapshot. diff --git a/core/Lucy/Index/DataWriter.cfh b/core/Lucy/Index/DataWriter.cfh index eb7f220f5..57733cc43 100644 --- a/core/Lucy/Index/DataWriter.cfh +++ b/core/Lucy/Index/DataWriter.cfh @@ -35,7 +35,8 @@ public class Lucy::Index::DataWriter inherits Clownfish::Obj { Schema *schema; Folder *folder; - /** + /** Abstract initializer. + * * @param snapshot The Snapshot that will be committed at the end of the * indexing session. * @param segment The Segment in progress. diff --git a/core/Lucy/Index/IndexManager.cfh b/core/Lucy/Index/IndexManager.cfh index 05a22b4d0..be6389a0e 100644 --- a/core/Lucy/Index/IndexManager.cfh +++ b/core/Lucy/Index/IndexManager.cfh @@ -39,10 +39,16 @@ public class Lucy::Index::IndexManager nickname IxManager uint32_t deletion_lock_timeout; uint32_t deletion_lock_interval; + /** Create a new IndexManager. + * + * @param host An identifier which should be unique per-machine. + * @param lock_factory A LockFactory. + */ public inert incremented IndexManager* new(String *host = NULL, LockFactory *lock_factory = NULL); - /** + /** Initialize an IndexManager. + * * @param host An identifier which should be unique per-machine. * @param lock_factory A LockFactory. */ diff --git a/core/Lucy/Index/IndexReader.cfh b/core/Lucy/Index/IndexReader.cfh index b5c936598..442b5768f 100644 --- a/core/Lucy/Index/IndexReader.cfh +++ b/core/Lucy/Index/IndexReader.cfh @@ -42,17 +42,27 @@ public class Lucy::Index::IndexReader nickname IxReader Lock *read_lock; Lock *deletion_lock; + /** Abstract initializer. + */ public inert nullable IndexReader* init(IndexReader *self, Schema *schema = NULL, Folder *folder, Snapshot *snapshot = NULL, Vector *segments = NULL, int32_t seg_tick = -1, IndexManager *manager = NULL); + /** IndexReader is an abstract base class; open() returns the IndexReader + * subclass PolyReader, which channels the output of 0 or more SegReaders. + * + * @param index Either a string filepath or a Folder. + * @param snapshot A Snapshot. If not supplied, the most recent snapshot + * file will be used. + * @param manager An [](cfish:IndexManager). + * Read-locking is off by default; supplying this argument turns it on. + */ public inert incremented nullable IndexReader* open(Obj *index, Snapshot *snapshot = NULL, IndexManager *manager = NULL); - /** IndexReader is an abstract base class; open() returns the IndexReader - * subclass PolyReader, which channels the output of 0 or more SegReaders. + /** Initialize and open an IndexReader. * * @param index Either a string filepath or a Folder. * @param snapshot A Snapshot. If not supplied, the most recent snapshot diff --git a/core/Lucy/Index/Indexer.cfh b/core/Lucy/Index/Indexer.cfh index 36d118c0f..5a01f8be7 100644 --- a/core/Lucy/Index/Indexer.cfh +++ b/core/Lucy/Index/Indexer.cfh @@ -60,11 +60,18 @@ public class Lucy::Index::Indexer inherits Clownfish::Obj { public inert int32_t TRUNCATE; public inert int32_t CREATE; + /** Open a new Indexer. If the index already exists, update it. + * + * @param schema A Schema. + * @param index Either a string filepath or a Folder. + * @param manager An IndexManager. + * @param flags Flags governing behavior. + */ public inert incremented Indexer* new(Schema *schema = NULL, Obj *index, IndexManager *manager = NULL, int32_t flags = 0); - /** Open a new Indexer. If the index already exists, update it. + /** Initialize an Indexer. * * @param schema A Schema. * @param index Either a string filepath or a Folder. diff --git a/core/Lucy/Index/Lexicon.cfh b/core/Lucy/Index/Lexicon.cfh index 303ce033b..301a0e6af 100644 --- a/core/Lucy/Index/Lexicon.cfh +++ b/core/Lucy/Index/Lexicon.cfh @@ -35,6 +35,8 @@ public class Lucy::Index::Lexicon nickname Lex inherits Clownfish::Obj { String *field; + /** Abstract initializer. + */ public inert Lexicon* init(Lexicon *self, String *field); diff --git a/core/Lucy/Index/PolyReader.cfh b/core/Lucy/Index/PolyReader.cfh index 970a309c2..6d362f8cc 100644 --- a/core/Lucy/Index/PolyReader.cfh +++ b/core/Lucy/Index/PolyReader.cfh @@ -33,10 +33,19 @@ public class Lucy::Index::PolyReader inherits Lucy::Index::IndexReader { int32_t del_count; I32Array *offsets; + /** Create and open a PolyReader. + * + * @param index Either a string filepath or a [](cfish:Folder). + * @param snapshot A Snapshot. If not supplied, the most recent snapshot + * file will be used. + * @param manager An [](cfish:IndexManager). + * Read-locking is off by default; supplying this argument turns it on. + */ public inert incremented nullable PolyReader* open(Obj *index, Snapshot *snapshot = NULL, IndexManager *manager = NULL); - /** + /** Initialize and open a PolyReader. + * * @param index Either a string filepath or a [](cfish:Folder). * @param snapshot A Snapshot. If not supplied, the most recent snapshot * file will be used. @@ -47,10 +56,14 @@ public class Lucy::Index::PolyReader inherits Lucy::Index::IndexReader { do_open(PolyReader *self, Obj *index, Snapshot *snapshot = NULL, IndexManager *manager = NULL); + /** Create a new PolyReader. + */ public inert incremented PolyReader* new(Schema *schema = NULL, Folder *folder, Snapshot *snapshot = NULL, IndexManager *manager = NULL, Vector *sub_readers = NULL); + /** Initialize a PolyReader. + */ public inert PolyReader* init(PolyReader *self, Schema *schema = NULL, Folder *folder, Snapshot *snapshot = NULL, IndexManager *manager = NULL, diff --git a/core/Lucy/Index/Posting.cfh b/core/Lucy/Index/Posting.cfh index 1c243bdf5..2d88cb683 100644 --- a/core/Lucy/Index/Posting.cfh +++ b/core/Lucy/Index/Posting.cfh @@ -31,6 +31,8 @@ class Lucy::Index::Posting nickname Post inherits Lucy::Util::Stepper { int32_t doc_id; + /** Abstract initializer. + */ public inert Posting* init(Posting *self); diff --git a/core/Lucy/Index/PostingList.cfh b/core/Lucy/Index/PostingList.cfh index 609acf8fa..fde9a7bc1 100644 --- a/core/Lucy/Index/PostingList.cfh +++ b/core/Lucy/Index/PostingList.cfh @@ -27,6 +27,8 @@ parcel Lucy; public class Lucy::Index::PostingList nickname PList inherits Lucy::Search::Matcher { + /** Abstract initializer. + */ public inert PostingList* init(PostingList *self); diff --git a/core/Lucy/Index/Segment.cfh b/core/Lucy/Index/Segment.cfh index c30ed95fb..778043804 100644 --- a/core/Lucy/Index/Segment.cfh +++ b/core/Lucy/Index/Segment.cfh @@ -40,9 +40,13 @@ public class Lucy::Index::Segment nickname Seg inherits Clownfish::Obj { Vector *by_num; /* field names by num */ Hash *metadata; - inert incremented Segment* + /** Create a new Segment. + */ + public inert incremented Segment* new(int64_t number); + /** Initialize a segment. + */ public inert Segment* init(Segment *self, int64_t number); diff --git a/core/Lucy/Index/Similarity.cfh b/core/Lucy/Index/Similarity.cfh index b3f288cad..76da8b1b2 100644 --- a/core/Lucy/Index/Similarity.cfh +++ b/core/Lucy/Index/Similarity.cfh @@ -37,10 +37,12 @@ public class Lucy::Index::Similarity nickname Sim inherits Clownfish::Obj { float *norm_decoder; - inert incremented Similarity* + /** Constructor. Takes no arguments. + */ + public inert incremented Similarity* new(); - /** Constructor. Takes no arguments. + /** Initialize a Similarity. */ public inert Similarity* init(Similarity *self); diff --git a/core/Lucy/Index/Snapshot.cfh b/core/Lucy/Index/Snapshot.cfh index e0af03898..e14fcd564 100644 --- a/core/Lucy/Index/Snapshot.cfh +++ b/core/Lucy/Index/Snapshot.cfh @@ -33,11 +33,12 @@ public class Lucy::Index::Snapshot inherits Clownfish::Obj { inert int32_t current_file_format; + /** Constructor. Takes no arguments. + */ public inert incremented Snapshot* new(); - /** - * Constructor. Takes no arguments. + /** Initialize a Snapshot. */ public inert Snapshot* init(Snapshot *self); diff --git a/core/Lucy/Index/SortCache.cfh b/core/Lucy/Index/SortCache.cfh index c2f351cd0..a082bdf6f 100644 --- a/core/Lucy/Index/SortCache.cfh +++ b/core/Lucy/Index/SortCache.cfh @@ -29,6 +29,8 @@ class Lucy::Index::SortCache inherits Clownfish::Obj { int32_t null_ord; bool native_ords; + /** Abstract initializer. + */ public inert SortCache* init(SortCache *self, String *field, FieldType *type, const void *ords, int32_t cardinality, int32_t doc_max, int32_t null_ord = -1, diff --git a/core/Lucy/Index/TermStepper.cfh b/core/Lucy/Index/TermStepper.cfh index 77c7533f7..7905cf5a2 100644 --- a/core/Lucy/Index/TermStepper.cfh +++ b/core/Lucy/Index/TermStepper.cfh @@ -21,6 +21,8 @@ abstract class Lucy::Index::TermStepper Obj *value; + /** Abstract initializer. + */ public inert TermStepper* init(TermStepper *self); diff --git a/core/Lucy/Object/BitVector.cfh b/core/Lucy/Object/BitVector.cfh index 3c01f5eaf..adfb6cb3c 100644 --- a/core/Lucy/Object/BitVector.cfh +++ b/core/Lucy/Object/BitVector.cfh @@ -27,10 +27,16 @@ public class Lucy::Object::BitVector nickname BitVec uint32_t cap; uint8_t *bits; - inert incremented BitVector* + /** Create a new BitVector. + * + * @param capacity The number of bits that the initial array should be + * able to hold. + */ + public inert incremented BitVector* new(uint32_t capacity = 0); - /** + /** Initialize a BitVector. + * * @param capacity The number of bits that the initial array should be * able to hold. */ diff --git a/core/Lucy/Plan/Architecture.cfh b/core/Lucy/Plan/Architecture.cfh index 28d7619e6..18b8aa011 100644 --- a/core/Lucy/Plan/Architecture.cfh +++ b/core/Lucy/Plan/Architecture.cfh @@ -27,10 +27,12 @@ parcel Lucy; */ public class Lucy::Plan::Architecture nickname Arch inherits Clownfish::Obj { + /** Constructor. Takes no arguments. + */ public inert incremented Architecture* new(); - /** Constructor. Takes no arguments. + /** Initialize an Architecture. */ public inert Architecture* init(Architecture *self); diff --git a/core/Lucy/Plan/BlobType.cfh b/core/Lucy/Plan/BlobType.cfh index 524552ba3..d1d36ae3e 100644 --- a/core/Lucy/Plan/BlobType.cfh +++ b/core/Lucy/Plan/BlobType.cfh @@ -23,15 +23,20 @@ parcel Lucy; */ public class Lucy::Plan::BlobType inherits Lucy::Plan::FieldType { - /** + /** Create a new BlobType. + * * @param stored boolean indicating whether the field should be stored. */ - public inert BlobType* - init(BlobType *self, bool stored); - public inert incremented BlobType* new(bool stored); + /** Initialize a BlobType. + * + * @param stored boolean indicating whether the field should be stored. + */ + public inert BlobType* + init(BlobType *self, bool stored); + /** Returns true. */ public bool diff --git a/core/Lucy/Plan/FullTextType.cfh b/core/Lucy/Plan/FullTextType.cfh index 933ec9f46..fd0505fe1 100644 --- a/core/Lucy/Plan/FullTextType.cfh +++ b/core/Lucy/Plan/FullTextType.cfh @@ -33,6 +33,16 @@ public class Lucy::Plan::FullTextType inherits Lucy::Plan::TextType { bool highlightable; Analyzer *analyzer; + /** Create a new FullTextType. + */ + public inert incremented FullTextType* + new(Analyzer *analyzer); + + /** Initialize a FullTextType. + */ + public inert FullTextType* + init(FullTextType *self, Analyzer *analyzer); + /** * @param analyzer An Analyzer. * @param boost floating point per-field boost. @@ -43,16 +53,10 @@ public class Lucy::Plan::FullTextType inherits Lucy::Plan::TextType { * highlightable. */ public inert FullTextType* - init(FullTextType *self, Analyzer *analyzer); - - inert FullTextType* init2(FullTextType *self, Analyzer *analyzer, float boost = 1.0, bool indexed = true, bool stored = true, bool sortable = false, bool highlightable = false); - public inert incremented FullTextType* - new(Analyzer *analyzer); - /** Indicate whether to store data required by * [](cfish:Highlighter) for excerpt selection and search * term highlighting. diff --git a/core/Lucy/Plan/NumericType.cfh b/core/Lucy/Plan/NumericType.cfh index 905e35bfc..68593bb42 100644 --- a/core/Lucy/Plan/NumericType.cfh +++ b/core/Lucy/Plan/NumericType.cfh @@ -18,6 +18,8 @@ parcel Lucy; class Lucy::Plan::NumericType nickname NumType inherits Lucy::Plan::FieldType { + /** Abstract initializer. + */ public inert NumericType* init(NumericType *self); @@ -50,9 +52,13 @@ abstract class Lucy::Plan::FloatType inherits Lucy::Plan::NumericType { } class Lucy::Plan::Float64Type inherits Lucy::Plan::FloatType { + /** Create a new Float64Type. + */ public inert Float64Type* new(); + /** Initialize a Float64Type. + */ public inert Float64Type* init(Float64Type *self); @@ -72,9 +78,13 @@ class Lucy::Plan::Float64Type inherits Lucy::Plan::FloatType { class Lucy::Plan::Float32Type inherits Lucy::Plan::FloatType { + /** Create a new Float32Type. + */ public inert Float32Type* new(); + /** Initialize a Float32Type. + */ public inert Float32Type* init(Float32Type *self); @@ -96,9 +106,13 @@ abstract class Lucy::Plan::IntType inherits Lucy::Plan::NumericType { } class Lucy::Plan::Int32Type inherits Lucy::Plan::IntType { + /** Create a new Int32Type. + */ public inert Int32Type* new(); + /** Initialize an Int32Type. + */ public inert Int32Type* init(Int32Type *self); @@ -118,9 +132,13 @@ class Lucy::Plan::Int32Type inherits Lucy::Plan::IntType { class Lucy::Plan::Int64Type inherits Lucy::Plan::IntType { + /** Create a new Int64Type. + */ public inert Int64Type* new(); + /** Initialize an Int64Type. + */ public inert Int64Type* init(Int64Type *self); diff --git a/core/Lucy/Plan/Schema.cfh b/core/Lucy/Plan/Schema.cfh index 32dbdfa2f..f00e5d127 100644 --- a/core/Lucy/Plan/Schema.cfh +++ b/core/Lucy/Plan/Schema.cfh @@ -34,10 +34,12 @@ public class Lucy::Plan::Schema inherits Clownfish::Obj { Hash *analyzers; Vector *uniq_analyzers; + /** Constructor. Takes no arguments. + */ public inert incremented Schema* new(); - /** Constructor. Takes no arguments. + /** Initialize a Schema. */ public inert Schema* init(Schema *self); diff --git a/core/Lucy/Plan/StringType.cfh b/core/Lucy/Plan/StringType.cfh index 90d1bc67f..105bacd19 100644 --- a/core/Lucy/Plan/StringType.cfh +++ b/core/Lucy/Plan/StringType.cfh @@ -22,6 +22,16 @@ parcel Lucy; */ public class Lucy::Plan::StringType inherits Lucy::Plan::TextType { + /** Create a new StringType. + */ + public inert incremented StringType* + new(); + + /** Initialize a StringType. + */ + public inert StringType* + init(StringType *self); + /** * @param boost floating point per-field boost. * @param indexed boolean indicating whether the field should be indexed. @@ -30,15 +40,9 @@ public class Lucy::Plan::StringType inherits Lucy::Plan::TextType { * sortable. */ public inert StringType* - init(StringType *self); - - inert StringType* init2(StringType *self, float boost = 1.0, bool indexed = true, bool stored = true, bool sortable = false); - public inert incremented StringType* - new(); - incremented Similarity* Make_Similarity(StringType *self); diff --git a/core/Lucy/Search/ANDQuery.cfh b/core/Lucy/Search/ANDQuery.cfh index 4f0402846..bc91b3925 100644 --- a/core/Lucy/Search/ANDQuery.cfh +++ b/core/Lucy/Search/ANDQuery.cfh @@ -24,10 +24,15 @@ parcel Lucy; */ public class Lucy::Search::ANDQuery inherits Lucy::Search::PolyQuery { - inert incremented ANDQuery* + /** Create a new ANDQuery. + * + * @param children An array of child Queries. + */ + public inert incremented ANDQuery* new(Vector *children = NULL); - /** + /** Initialize an ANDQuery. + * * @param children An array of child Queries. */ public inert ANDQuery* diff --git a/core/Lucy/Search/Collector.cfh b/core/Lucy/Search/Collector.cfh index 2bb44ddbc..5ab9cad96 100644 --- a/core/Lucy/Search/Collector.cfh +++ b/core/Lucy/Search/Collector.cfh @@ -35,7 +35,7 @@ public abstract class Lucy::Search::Collector nickname Coll Matcher *matcher; int32_t base; - /** Abstract constructor. Takes no arguments. + /** Abstract initializer. */ public inert Collector* init(Collector *self); @@ -85,10 +85,15 @@ public class Lucy::Search::Collector::BitCollector nickname BitColl BitVector *bit_vec; + /** Create a new BitCollector. + * + * @param bit_vector A Lucy::Object::BitVector. + */ public inert incremented BitCollector* new(BitVector *bit_vector); - /** + /** Initialize a BitCollector. + * * @param bit_vector A Lucy::Object::BitVector. */ public inert BitCollector* diff --git a/core/Lucy/Search/Compiler.cfh b/core/Lucy/Search/Compiler.cfh index 9c6924cca..77805897c 100644 --- a/core/Lucy/Search/Compiler.cfh +++ b/core/Lucy/Search/Compiler.cfh @@ -62,7 +62,7 @@ public class Lucy::Search::Compiler inherits Lucy::Search::Query { Query *parent; Similarity *sim; - /** Abstract constructor. + /** Abstract initializer. * * @param parent The parent Query. * @param searcher A Lucy::Search::Searcher, such as an diff --git a/core/Lucy/Search/IndexSearcher.cfh b/core/Lucy/Search/IndexSearcher.cfh index f6d052451..77fb4c921 100644 --- a/core/Lucy/Search/IndexSearcher.cfh +++ b/core/Lucy/Search/IndexSearcher.cfh @@ -35,10 +35,15 @@ public class Lucy::Search::IndexSearcher nickname IxSearcher Vector *seg_readers; I32Array *seg_starts; - inert incremented IndexSearcher* + /** Create a new IndexSearcher. + * + * @param index Either a string filepath, a Folder, or an IndexReader. + */ + public inert incremented IndexSearcher* new(Obj *index); - /** + /** Initialize an IndexSearcher. + * * @param index Either a string filepath, a Folder, or an IndexReader. */ public inert IndexSearcher* diff --git a/core/Lucy/Search/LeafQuery.cfh b/core/Lucy/Search/LeafQuery.cfh index d9d8fa3bb..fbe8e967d 100644 --- a/core/Lucy/Search/LeafQuery.cfh +++ b/core/Lucy/Search/LeafQuery.cfh @@ -30,10 +30,16 @@ public class Lucy::Search::LeafQuery inherits Lucy::Search::Query { String *field; String *text; - inert incremented LeafQuery* + /** Create a new LeafQuery. + * + * @param field Optional field name. + * @param text Raw query text. + */ + public inert incremented LeafQuery* new(String *field = NULL, String *text); - /** + /** Initialize a LeafQuery. + * * @param field Optional field name. * @param text Raw query text. */ diff --git a/core/Lucy/Search/MatchAllQuery.cfh b/core/Lucy/Search/MatchAllQuery.cfh index 3e4295dd3..bdcf6ef9f 100644 --- a/core/Lucy/Search/MatchAllQuery.cfh +++ b/core/Lucy/Search/MatchAllQuery.cfh @@ -25,10 +25,12 @@ parcel Lucy; */ public class Lucy::Search::MatchAllQuery inherits Lucy::Search::Query { - inert incremented MatchAllQuery* + /** Constructor. Takes no arguments. + */ + public inert incremented MatchAllQuery* new(); - /** Constructor. Takes no arguments. + /** Initialize a MatchAllQuery. */ public inert MatchAllQuery* init(MatchAllQuery *self); diff --git a/core/Lucy/Search/Matcher.cfh b/core/Lucy/Search/Matcher.cfh index ed27061da..b2fd05789 100644 --- a/core/Lucy/Search/Matcher.cfh +++ b/core/Lucy/Search/Matcher.cfh @@ -25,7 +25,7 @@ parcel Lucy; public abstract class Lucy::Search::Matcher inherits Clownfish::Obj { - /** Abstract constructor. + /** Abstract initializer. */ public inert Matcher* init(Matcher* self); diff --git a/core/Lucy/Search/NOTQuery.cfh b/core/Lucy/Search/NOTQuery.cfh index 9b5493d27..8e6e77247 100644 --- a/core/Lucy/Search/NOTQuery.cfh +++ b/core/Lucy/Search/NOTQuery.cfh @@ -29,13 +29,15 @@ parcel Lucy; public class Lucy::Search::NOTQuery inherits Lucy::Search::PolyQuery { - /** - * @param negated_query The Query to be inverted. + /** Create a new NOTQuery. + * + * @param negated_query The Query whose result set should be inverted. */ - inert incremented NOTQuery* + public inert incremented NOTQuery* new(Query *negated_query); - /** + /** Initialize a NOTQuery. + * * @param negated_query The Query whose result set should be inverted. */ public inert NOTQuery* diff --git a/core/Lucy/Search/NoMatchQuery.cfh b/core/Lucy/Search/NoMatchQuery.cfh index 971a548d5..b9f93903a 100644 --- a/core/Lucy/Search/NoMatchQuery.cfh +++ b/core/Lucy/Search/NoMatchQuery.cfh @@ -27,10 +27,12 @@ public class Lucy::Search::NoMatchQuery inherits Lucy::Search::Query { bool fails_to_match; - inert incremented NoMatchQuery* + /** Constructor. Takes no arguments. + */ + public inert incremented NoMatchQuery* new(); - /** Constructor. Takes no arguments. + /** Initialize a NoMatchQuery. */ public inert NoMatchQuery* init(NoMatchQuery *self); diff --git a/core/Lucy/Search/ORQuery.cfh b/core/Lucy/Search/ORQuery.cfh index aa3865618..66c747182 100644 --- a/core/Lucy/Search/ORQuery.cfh +++ b/core/Lucy/Search/ORQuery.cfh @@ -26,10 +26,15 @@ parcel Lucy; public class Lucy::Search::ORQuery inherits Lucy::Search::PolyQuery { - inert incremented ORQuery* + /** Create a new ORQuery. + * + * @param children An array of child Queries. + */ + public inert incremented ORQuery* new(Vector *children = NULL); - /** + /** Initialize an ORQuery. + * * @param children An array of child Queries. */ public inert ORQuery* diff --git a/core/Lucy/Search/PhraseQuery.cfh b/core/Lucy/Search/PhraseQuery.cfh index 9c1c2f61d..587b36c43 100644 --- a/core/Lucy/Search/PhraseQuery.cfh +++ b/core/Lucy/Search/PhraseQuery.cfh @@ -27,10 +27,16 @@ public class Lucy::Search::PhraseQuery inherits Lucy::Search::Query { String *field; Vector *terms; - inert incremented PhraseQuery* + /** Create a new PhraseQuery. + * + * @param field The field that the phrase must occur in. + * @param terms The ordered array of terms that must match. + */ + public inert incremented PhraseQuery* new(String *field, Vector *terms); - /** + /** Initialize a PhraseQuery. + * * @param field The field that the phrase must occur in. * @param terms The ordered array of terms that must match. */ diff --git a/core/Lucy/Search/PolyQuery.cfh b/core/Lucy/Search/PolyQuery.cfh index 36dae7a89..b3c07d56e 100644 --- a/core/Lucy/Search/PolyQuery.cfh +++ b/core/Lucy/Search/PolyQuery.cfh @@ -30,7 +30,8 @@ public abstract class Lucy::Search::PolyQuery inherits Lucy::Search::Query { Vector *children; - /** + /** Abstract initializer. + * * @param children An array of child Queries. */ public inert PolyQuery* diff --git a/core/Lucy/Search/PolySearcher.cfh b/core/Lucy/Search/PolySearcher.cfh index 8774c7e93..19427a6b3 100644 --- a/core/Lucy/Search/PolySearcher.cfh +++ b/core/Lucy/Search/PolySearcher.cfh @@ -29,10 +29,16 @@ public class Lucy::Search::PolySearcher I32Array *starts; int32_t doc_max; - inert incremented PolySearcher* + /** Create a new PolySearcher. + * + * @param schema A Schema. + * @param searchers An array of Searchers. + */ + public inert incremented PolySearcher* new(Schema *schema, Vector *searchers); - /** + /** Initialize a PolySearcher. + * * @param schema A Schema. * @param searchers An array of Searchers. */ diff --git a/core/Lucy/Search/Query.cfh b/core/Lucy/Search/Query.cfh index cb8aec230..8b19d4b5e 100644 --- a/core/Lucy/Search/Query.cfh +++ b/core/Lucy/Search/Query.cfh @@ -38,7 +38,7 @@ public class Lucy::Search::Query inherits Clownfish::Obj { float boost; - /** Abstract constructor. + /** Abstract initializer. * * @param boost A scoring multiplier, affecting the Query's relative * contribution to each document's score. Typically defaults to 1.0, but diff --git a/core/Lucy/Search/QueryParser.cfh b/core/Lucy/Search/QueryParser.cfh index 376ddfb0a..13fb1ea9a 100644 --- a/core/Lucy/Search/QueryParser.cfh +++ b/core/Lucy/Search/QueryParser.cfh @@ -51,11 +51,27 @@ public class Lucy::Search::QueryParser nickname QParser bool heed_colons; int32_t default_occur; - inert incremented QueryParser* + /** Constructor. + * + * @param schema A [](cfish:Schema). + * @param analyzer An [](cfish:Analyzer). + * Ordinarily, the analyzers specified by each field's definition will be + * used, but if `analyzer` is supplied, it will override and be used for + * all fields. This can lead to mismatches between what is in the index + * and what is being searched for, so use caution. + * @param fields The names of the fields which will be searched against. + * Defaults to those fields which are defined as indexed in the supplied + * Schema. + * @param default_boolop Two possible values: 'AND' and 'OR'. The default + * is 'OR', which means: return documents which match any of the query + * terms. If you want only documents which match all of the query terms, + * set this to 'AND'. + */ + public inert incremented QueryParser* new(Schema *schema, Analyzer *analyzer = NULL, String *default_boolop = NULL, Vector *fields = NULL); - /** Constructor. + /** Initialize a QueryParser. * * @param schema A [](cfish:Schema). * @param analyzer An [](cfish:Analyzer). diff --git a/core/Lucy/Search/RangeQuery.cfh b/core/Lucy/Search/RangeQuery.cfh index 254f1ec26..2c4624c95 100644 --- a/core/Lucy/Search/RangeQuery.cfh +++ b/core/Lucy/Search/RangeQuery.cfh @@ -30,13 +30,10 @@ public class Lucy::Search::RangeQuery inherits Lucy::Search::Query { bool include_lower; bool include_upper; - inert incremented RangeQuery* - new(String *field, Obj *lower_term = NULL, Obj *upper_term = NULL, - bool include_lower = true, bool include_upper = true); - - /** Takes 5 parameters; `field` is required, as - * is at least one of either `lower_term` or - * `upper_term`. + /** Create a new RangeQuery. + * + * Takes 5 parameters; `field` is required, as is at least one of either + * `lower_term` or `upper_term`. * * @param field The name of a `sortable` field. * @param lower_term Lower delimiter. If not supplied, all values @@ -48,6 +45,13 @@ public class Lucy::Search::RangeQuery inherits Lucy::Search::Query { * @param include_upper Indicates whether docs which match * `upper_term` should be included in the results. */ + public inert incremented RangeQuery* + new(String *field, Obj *lower_term = NULL, Obj *upper_term = NULL, + bool include_lower = true, bool include_upper = true); + + /** Initialize a RangeQuery. See [](.new) for a description of the + * parameters. + */ public inert RangeQuery* init(RangeQuery *self, String *field, Obj *lower_term = NULL, Obj *upper_term = NULL, diff --git a/core/Lucy/Search/RequiredOptionalQuery.cfh b/core/Lucy/Search/RequiredOptionalQuery.cfh index 9dc20f771..35481a40d 100644 --- a/core/Lucy/Search/RequiredOptionalQuery.cfh +++ b/core/Lucy/Search/RequiredOptionalQuery.cfh @@ -26,10 +26,16 @@ parcel Lucy; public class Lucy::Search::RequiredOptionalQuery nickname ReqOptQuery inherits Lucy::Search::PolyQuery { - inert incremented RequiredOptionalQuery* + /** Create a new RequiredOptionalQuery. + * + * @param required_query Query must must match. + * @param optional_query Query which should match. + */ + public inert incremented RequiredOptionalQuery* new(Query *required_query, Query *optional_query); - /** + /** Initialize a RequiredOptionalQuery. + * * @param required_query Query must must match. * @param optional_query Query which should match. */ diff --git a/core/Lucy/Search/Searcher.cfh b/core/Lucy/Search/Searcher.cfh index 67263d75e..2eeba6db6 100644 --- a/core/Lucy/Search/Searcher.cfh +++ b/core/Lucy/Search/Searcher.cfh @@ -28,7 +28,7 @@ public class Lucy::Search::Searcher inherits Clownfish::Obj { Schema *schema; QueryParser *qparser; - /** Abstract constructor. + /** Abstract initializer. * * @param schema A Schema. */ diff --git a/core/Lucy/Search/SortRule.cfh b/core/Lucy/Search/SortRule.cfh index d9da9682f..bb467cf7c 100644 --- a/core/Lucy/Search/SortRule.cfh +++ b/core/Lucy/Search/SortRule.cfh @@ -33,17 +33,21 @@ public class Lucy::Search::SortRule inherits Clownfish::Obj { inert int32_t SCORE; inert int32_t DOC_ID; - public inert incremented SortRule* - new(int32_t type = 0, String *field = NULL, - bool reverse = false); - - /** + /** Create a new SortRule. + * * @param type Indicate whether to sort by score, field, etc. (The * default is to sort by a field.) * @param field The name of a `sortable` field. * @param reverse If true, reverse the order of the sort for this rule. */ public inert incremented SortRule* + new(int32_t type = 0, String *field = NULL, + bool reverse = false); + + /** Initialize a SortRule. See [](.new) for a description of the + * parameters. + */ + public inert incremented SortRule* init(SortRule *self, int32_t type = 0, String *field = NULL, bool reverse = false); diff --git a/core/Lucy/Search/SortSpec.cfh b/core/Lucy/Search/SortSpec.cfh index a820dc3e6..311d1772e 100644 --- a/core/Lucy/Search/SortSpec.cfh +++ b/core/Lucy/Search/SortSpec.cfh @@ -32,10 +32,15 @@ public class Lucy::Search::SortSpec inherits Clownfish::Obj { Vector *rules; + /** Create a new SortSpec. + * + * @param rules An array of SortRules. + */ public inert SortSpec* new(Vector *rules); - /** + /** Initialize a SortSpec. + * * @param rules An array of SortRules. */ public inert SortSpec* diff --git a/core/Lucy/Search/Span.cfh b/core/Lucy/Search/Span.cfh index 43c17a1b8..be1341cc2 100644 --- a/core/Lucy/Search/Span.cfh +++ b/core/Lucy/Search/Span.cfh @@ -32,14 +32,18 @@ public class Lucy::Search::Span inherits Clownfish::Obj { int32_t length; float weight; - inert incremented Span* - new(int32_t offset, int32_t length, float weight = 0.0); - - /** + /** Create a new Span. + * * @param offset Integer offset, unit is context-dependent. * @param length Integer length, unit is context-dependent. * @param weight A floating point weight. */ + public inert incremented Span* + new(int32_t offset, int32_t length, float weight = 0.0); + + /** Initialize a Span. See [](.new) for a description of the + * parameters. + */ public inert Span* init(Span *self, int32_t offset, int32_t length, float weight = 0.0); diff --git a/core/Lucy/Search/TermQuery.cfh b/core/Lucy/Search/TermQuery.cfh index ea50003c4..b2fc00fbf 100644 --- a/core/Lucy/Search/TermQuery.cfh +++ b/core/Lucy/Search/TermQuery.cfh @@ -28,10 +28,16 @@ public class Lucy::Search::TermQuery inherits Lucy::Search::Query { String *field; Obj *term; - inert incremented TermQuery* + /** Create a new TermQuery. + * + * @param field Field name. + * @param term Term text. + */ + public inert incremented TermQuery* new(String *field, Obj *term); - /** + /** Initialize a TermQuery. + * * @param field Field name. * @param term Term text. */ diff --git a/core/Lucy/Simple.cfh b/core/Lucy/Simple.cfh index d3cdcfa43..292b41008 100644 --- a/core/Lucy/Simple.cfh +++ b/core/Lucy/Simple.cfh @@ -59,6 +59,8 @@ public class Lucy::Simple { public inert Simple* new(Obj *path, String *language); + /** Initialize a Lucy::Simple object. + */ public inert Simple* init(Simple *self, Obj *path, String *language); diff --git a/core/Lucy/Store/FSFolder.cfh b/core/Lucy/Store/FSFolder.cfh index 640842004..ff35ae10d 100644 --- a/core/Lucy/Store/FSFolder.cfh +++ b/core/Lucy/Store/FSFolder.cfh @@ -24,15 +24,19 @@ parcel Lucy; public class Lucy::Store::FSFolder inherits Lucy::Store::Folder { - inert incremented FSFolder* - new(String *path); - - /** + /** Create a new Folder. + * * @param path Location of the index. If the specified directory does * not exist already, it will NOT be created, in order to prevent * misconfigured read applications from spawning bogus files -- so it may * be necessary to create the directory yourself. */ + public inert incremented FSFolder* + new(String *path); + + /** Initialize a Folder. See [](.new) for a description of the + * parameters. + */ public inert FSFolder* init(FSFolder *self, String *path); diff --git a/core/Lucy/Store/Folder.cfh b/core/Lucy/Store/Folder.cfh index 9f841cf6b..f28306cba 100644 --- a/core/Lucy/Store/Folder.cfh +++ b/core/Lucy/Store/Folder.cfh @@ -31,6 +31,8 @@ public abstract class Lucy::Store::Folder inherits Clownfish::Obj { String *path; Hash *entries; + /** Abstract initializer. + */ public inert nullable Folder* init(Folder *self, String *path); diff --git a/core/Lucy/Store/Lock.cfh b/core/Lucy/Store/Lock.cfh index 113467a98..d801a0c11 100644 --- a/core/Lucy/Store/Lock.cfh +++ b/core/Lucy/Store/Lock.cfh @@ -36,7 +36,7 @@ public abstract class Lucy::Store::Lock inherits Clownfish::Obj { int32_t timeout; int32_t interval; - /** Abstract constructor. + /** Abstract initializer. * * @param folder A Folder. * @param name String identifying the resource to be locked, which must diff --git a/core/Lucy/Store/LockFactory.cfh b/core/Lucy/Store/LockFactory.cfh index 0feb459ff..383d271a2 100644 --- a/core/Lucy/Store/LockFactory.cfh +++ b/core/Lucy/Store/LockFactory.cfh @@ -30,10 +30,16 @@ public class Lucy::Store::LockFactory nickname LockFact Folder *folder; String *host; - inert incremented LockFactory* + /** Create a new LockFactory. + * + * @param folder A [](cfish:Folder). + * @param host An identifier which should be unique per-machine. + */ + public inert incremented LockFactory* new(Folder *folder, String *host); - /** + /** Initialize a LockFactory. + * * @param folder A [](cfish:Folder). * @param host An identifier which should be unique per-machine. */ diff --git a/core/Lucy/Store/RAMFolder.cfh b/core/Lucy/Store/RAMFolder.cfh index 909b70a00..bed43086d 100644 --- a/core/Lucy/Store/RAMFolder.cfh +++ b/core/Lucy/Store/RAMFolder.cfh @@ -24,10 +24,15 @@ parcel Lucy; public class Lucy::Store::RAMFolder inherits Lucy::Store::Folder { - inert incremented RAMFolder* + /** Create a new RAMFolder. + * + * @param path Relative path, used for subfolders. + */ + public inert incremented RAMFolder* new(String *path = NULL); - /** + /** Initialize a RAMFolder. + * * @param path Relative path, used for subfolders. */ public inert RAMFolder* diff --git a/core/LucyX/Search/ProximityQuery.cfh b/core/LucyX/Search/ProximityQuery.cfh index 5269c18a0..c3798ffb5 100644 --- a/core/LucyX/Search/ProximityQuery.cfh +++ b/core/LucyX/Search/ProximityQuery.cfh @@ -28,10 +28,16 @@ public class LucyX::Search::ProximityQuery inherits Lucy::Search::Query { Vector *terms; uint32_t within; - inert incremented ProximityQuery* + /** Create a new ProximityQuery. + * + * @param field The field that the phrase must occur in. + * @param terms The ordered array of terms that must match. + */ + public inert incremented ProximityQuery* new(String *field, Vector *terms, uint32_t within); - /** + /** Initialize a ProximityQuery. + * * @param field The field that the phrase must occur in. * @param terms The ordered array of terms that must match. */ diff --git a/perl/buildlib/Lucy/Build/Binding/Index.pm b/perl/buildlib/Lucy/Build/Binding/Index.pm index cf1d30775..595d83841 100644 --- a/perl/buildlib/Lucy/Build/Binding/Index.pm +++ b/perl/buildlib/Lucy/Build/Binding/Index.pm @@ -77,6 +77,8 @@ sub bind_datareader { # Abstract base class. END_SYNOPSIS my $constructor = <<'END_CONSTRUCTOR'; +=head2 new + my $reader = MyDataReader->new( schema => $seg_reader->get_schema, # default undef folder => $seg_reader->get_folder, # default undef @@ -84,9 +86,38 @@ END_SYNOPSIS segments => $seg_reader->get_segments, # default undef seg_tick => $seg_reader->get_seg_tick, # default -1 ); + +Abstract constructor. + +=over + +=item * + +B - A Schema. + +=item * + +B - A Folder. + +=item * + +B - A Snapshot. + +=item * + +B - An array of Segments. + +=item * + +B - The array index of the Segment object within the +C array that this particular DataReader is assigned +to, if any. A value of -1 indicates that no Segment should be +assigned. + +=back END_CONSTRUCTOR $pod_spec->set_synopsis($synopsis); - $pod_spec->add_constructor( alias => 'new', sample => $constructor, ); + $pod_spec->add_constructor( alias => 'new', pod => $constructor, ); my $binding = Clownfish::CFC::Binding::Perl::Class->new( parcel => "Lucy", @@ -103,14 +134,37 @@ sub bind_datawriter { # Abstract base class. END_SYNOPSIS my $constructor = <<'END_CONSTRUCTOR'; +=head2 new + my $writer = MyDataWriter->new( snapshot => $snapshot, # required segment => $segment, # required polyreader => $polyreader, # required ); + +Abstract constructor. + +=over + +=item * + +B - The Snapshot that will be committed at the end of the +indexing session. + +=item * + +B - The Segment in progress. + +=item * + +B - A PolyReader representing all existing data in the +index. (If the index is brand new, the PolyReader will have no +sub-readers). + +=back END_CONSTRUCTOR $pod_spec->set_synopsis($synopsis); - $pod_spec->add_constructor( alias => 'new', sample => $constructor, ); + $pod_spec->add_constructor( alias => 'new', pod => $constructor, ); my $binding = Clownfish::CFC::Binding::Perl::Class->new( parcel => "Lucy", @@ -226,7 +280,6 @@ END_CONSTRUCTOR $pod_spec->set_synopsis($synopsis); $pod_spec->add_constructor( alias => 'open', - initializer => 'do_open', sample => $constructor, ); $pod_spec->add_method( diff --git a/perl/buildlib/Lucy/Build/Binding/Plan.pm b/perl/buildlib/Lucy/Build/Binding/Plan.pm index 6ddd03ad7..532c41c5d 100644 --- a/perl/buildlib/Lucy/Build/Binding/Plan.pm +++ b/perl/buildlib/Lucy/Build/Binding/Plan.pm @@ -188,7 +188,11 @@ END_SYNOPSIS ); END_CONSTRUCTOR $pod_spec->set_synopsis($synopsis); - $pod_spec->add_constructor( alias => 'new', sample => $constructor, ); + $pod_spec->add_constructor( + alias => 'new', + pod_func => 'init2', + sample => $constructor, + ); my $binding = Clownfish::CFC::Binding::Perl::Class->new( parcel => "Lucy", @@ -270,7 +274,11 @@ END_SYNOPSIS ); END_CONSTRUCTOR $pod_spec->set_synopsis($synopsis); - $pod_spec->add_constructor( alias => 'new', sample => $constructor, ); + $pod_spec->add_constructor( + alias => 'new', + pod_func => 'init2', + sample => $constructor, + ); my $binding = Clownfish::CFC::Binding::Perl::Class->new( parcel => "Lucy", diff --git a/perl/buildlib/Lucy/Build/Binding/Search.pm b/perl/buildlib/Lucy/Build/Binding/Search.pm index 46beef56f..7929c3080 100644 --- a/perl/buildlib/Lucy/Build/Binding/Search.pm +++ b/perl/buildlib/Lucy/Build/Binding/Search.pm @@ -79,6 +79,8 @@ END_CONSTRUCTOR sub bind_collector { my $pod_spec = Clownfish::CFC::Binding::Perl::Pod->new; my $constructor = <<'END_CONSTRUCTOR'; +=head2 new + package MyCollector; use base qw( Lucy::Search::Collector ); our %foo; @@ -88,9 +90,11 @@ sub bind_collector { $foo{$$self} = $args{foo}; return $self; } + +Abstract constructor. Takes no arguments. END_CONSTRUCTOR $pod_spec->set_synopsis(" # Abstract base class.\n"); - $pod_spec->add_constructor( alias => 'new', sample => $constructor, ); + $pod_spec->add_constructor( alias => 'new', pod => $constructor, ); my $binding = Clownfish::CFC::Binding::Perl::Class->new( parcel => "Lucy", @@ -144,16 +148,42 @@ sub bind_compiler { return MyMatcher->new( @_, compiler => $self ); } END_SYNOPSIS - my $constructor = <<'END_CONSTRUCTOR_CODE_SAMPLE'; + my $constructor = <<'END_CONSTRUCTOR_POD'; +=head2 new + my $compiler = MyCompiler->SUPER::new( parent => $my_query, searcher => $searcher, similarity => $sim, # default: undef boost => undef, # default: see below ); -END_CONSTRUCTOR_CODE_SAMPLE + +Abstract constructor. + +=over + +=item * + +B - The parent Query. + +=item * + +B - A Lucy::Search::Searcher, such as an +IndexSearcher. + +=item * + +B - A Similarity. + +=item * + +B - An arbitrary scoring multiplier. Defaults to the boost of +the parent Query. + +=back +END_CONSTRUCTOR_POD $pod_spec->set_synopsis($synopsis); - $pod_spec->add_constructor( alias => 'new', sample => $constructor, ); + $pod_spec->add_constructor( alias => 'new', pod => $constructor, ); my $binding = Clownfish::CFC::Binding::Perl::Class->new( parcel => "Lucy", @@ -275,11 +305,15 @@ sub bind_matcher { my $synopsis = <<'END_SYNOPSIS'; # abstract base class END_SYNOPSIS - my $constructor = <<'END_CONSTRUCTOR_CODE_SAMPLE'; + my $constructor = <<'END_CONSTRUCTOR_POD'; +=head2 new + my $matcher = MyMatcher->SUPER::new; -END_CONSTRUCTOR_CODE_SAMPLE + +Abstract constructor. +END_CONSTRUCTOR_POD $pod_spec->set_synopsis($synopsis); - $pod_spec->add_constructor( alias => 'new', sample => $constructor, ); + $pod_spec->add_constructor( alias => 'new', pod => $constructor, ); my $binding = Clownfish::CFC::Binding::Perl::Class->new( parcel => "Lucy", @@ -550,13 +584,28 @@ sub bind_query { use base ( Lucy::Search::Compiler ); ... END_SYNOPSIS - my $constructor = <<'END_CONSTRUCTOR_CODE_SAMPLE'; + my $constructor = <<'END_CONSTRUCTOR_POD'; +=head2 new + my $query = MyQuery->SUPER::new( boost => 2.5, ); -END_CONSTRUCTOR_CODE_SAMPLE + +Abstract constructor. + +=over + +=item * + +B - A scoring multiplier, affecting the Query's relative +contribution to each document's score. Typically defaults to 1.0, but +subclasses which do not contribute to document scores such as NOTQuery +and MatchAllQuery default to 0.0 instead. + +=back +END_CONSTRUCTOR_POD $pod_spec->set_synopsis($synopsis); - $pod_spec->add_constructor( alias => 'new', sample => $constructor, ); + $pod_spec->add_constructor( alias => 'new', pod => $constructor, ); my $binding = Clownfish::CFC::Binding::Perl::Class->new( parcel => "Lucy", @@ -668,6 +717,8 @@ END_CONSTRUCTOR sub bind_searcher { my $pod_spec = Clownfish::CFC::Binding::Perl::Pod->new; my $constructor = <<'END_CONSTRUCTOR'; +=head2 new + package MySearcher; use base qw( Lucy::Search::Searcher ); sub new { @@ -675,9 +726,19 @@ sub bind_searcher { ... return $self; } + +Abstract constructor. + +=over + +=item * + +B - A Schema. + +=back END_CONSTRUCTOR $pod_spec->set_synopsis(" # Abstract base class.\n"); - $pod_spec->add_constructor( alias => 'new', sample => $constructor, ); + $pod_spec->add_constructor( alias => 'new', pod => $constructor, ); my $binding = Clownfish::CFC::Binding::Perl::Class->new( parcel => "Lucy", diff --git a/perl/buildlib/Lucy/Build/Binding/Store.pm b/perl/buildlib/Lucy/Build/Binding/Store.pm index a02ab2a7c..053885b20 100644 --- a/perl/buildlib/Lucy/Build/Binding/Store.pm +++ b/perl/buildlib/Lucy/Build/Binding/Store.pm @@ -225,6 +225,8 @@ sub bind_lock { $lock->release; END_SYNOPSIS my $constructor = <<'END_CONSTRUCTOR'; +=head2 new + my $lock = Lucy::Store::Lock->new( name => 'commit', # required folder => $folder, # required @@ -232,9 +234,37 @@ END_SYNOPSIS timeout => 5000, # default: 0 interval => 1000, # default: 100 ); + +Abstract constructor. + +=over + +=item * + +B - A Folder. + +=item * + +B - String identifying the resource to be locked, which must +consist solely of characters matching [-_.A-Za-z0-9]. + +=item * + +B - A unique per-machine identifier. + +=item * + +B - Time in milliseconds to keep retrying before abandoning +the attempt to L a lock. + +=item * + +B - Time in milliseconds between retries. + +=back END_CONSTRUCTOR $pod_spec->set_synopsis($synopsis); - $pod_spec->add_constructor( alias => 'new', sample => $constructor, ); + $pod_spec->add_constructor( alias => 'new', pod => $constructor, ); my $binding = Clownfish::CFC::Binding::Perl::Class->new( parcel => "Lucy", From 2889932c424bf707bc69ee873bb159d9334484f5 Mon Sep 17 00:00:00 2001 From: Nick Wellnhofer Date: Tue, 9 Feb 2016 16:22:30 +0100 Subject: [PATCH 2/6] Fix typo --- core/Lucy/Analysis/RegexTokenizer.cfh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/Lucy/Analysis/RegexTokenizer.cfh b/core/Lucy/Analysis/RegexTokenizer.cfh index 9b986fae1..c36db2a4f 100644 --- a/core/Lucy/Analysis/RegexTokenizer.cfh +++ b/core/Lucy/Analysis/RegexTokenizer.cfh @@ -69,7 +69,7 @@ public class Lucy::Analysis::RegexTokenizer public inert incremented RegexTokenizer* new(String *pattern = NULL); - /** Initilaize a RegexTokenizer. + /** Initialize a RegexTokenizer. * * @param pattern A string specifying a Perl-syntax regular expression * which should match one token. The default value is From bc7b8fc3a279a99305c5063f5f001c869fafa44d Mon Sep 17 00:00:00 2001 From: Nick Wellnhofer Date: Tue, 9 Feb 2016 16:23:52 +0100 Subject: [PATCH 3/6] Add POD for Lucy::Simple ctor --- perl/buildlib/Lucy/Build/Binding/Misc.pm | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/perl/buildlib/Lucy/Build/Binding/Misc.pm b/perl/buildlib/Lucy/Build/Binding/Misc.pm index 08460216c..8eac8ca9a 100644 --- a/perl/buildlib/Lucy/Build/Binding/Misc.pm +++ b/perl/buildlib/Lucy/Build/Binding/Misc.pm @@ -154,6 +154,12 @@ Later, search the index. print "$hit->{title}\n", } END_SYNOPSIS + my $constructor = <<'END_CONSTRUCTOR'; + my $lucy = Lucy::Simple->new( + path => '/path/to/index/', + language => 'en', + ); +END_CONSTRUCTOR my $add_doc_pod = <<'END_ADD_DOC_POD'; =head2 add_doc @@ -169,6 +175,7 @@ with field names as keys and content as values. END_ADD_DOC_POD $pod_spec->set_synopsis($synopsis); + $pod_spec->add_constructor( sample => $constructor ); # Override is necessary because there's no standard way to explain # hash/hashref across multiple host languages. $pod_spec->add_method( From 61d89111b49157e9cd6419664da26e57ee3ba55c Mon Sep 17 00:00:00 2001 From: Nick Wellnhofer Date: Tue, 9 Feb 2016 16:28:46 +0100 Subject: [PATCH 4/6] Add POD for Analyzer abstract ctor --- perl/buildlib/Lucy/Build/Binding/Analysis.pm | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/perl/buildlib/Lucy/Build/Binding/Analysis.pm b/perl/buildlib/Lucy/Build/Binding/Analysis.pm index 22315d16d..a17ea3827 100644 --- a/perl/buildlib/Lucy/Build/Binding/Analysis.pm +++ b/perl/buildlib/Lucy/Build/Binding/Analysis.pm @@ -36,7 +36,23 @@ sub bind_all { sub bind_analyzer { my $pod_spec = Clownfish::CFC::Binding::Perl::Pod->new; + my $constructor = <<'END_CONSTRUCTOR'; +=head2 new + + package MyAnalyzer; + use base qw( Lucy::Analysis::Analyzer ); + our %foo; + sub new { + my $self = shift->SUPER::new; + my %args = @_; + $foo{$$self} = $args{foo}; + return $self; + } + +Abstract constructor. Takes no arguments. +END_CONSTRUCTOR $pod_spec->set_synopsis(" # Abstract base class.\n"); + $pod_spec->add_constructor( pod => $constructor ); my $binding = Clownfish::CFC::Binding::Perl::Class->new( parcel => "Lucy", From f8debe51d20aaa1b2dd1a3deb6c2389b73da3386 Mon Sep 17 00:00:00 2001 From: Nick Wellnhofer Date: Tue, 9 Feb 2016 16:37:55 +0100 Subject: [PATCH 5/6] Make some ctors non-public Remove the C API documentation for some ctors to match the Perl API. --- core/Lucy/Index/IndexReader.cfh | 2 +- core/Lucy/Index/Lexicon.cfh | 2 +- core/Lucy/Index/PolyReader.cfh | 4 ++-- core/Lucy/Index/PostingList.cfh | 2 +- core/Lucy/Index/Segment.cfh | 4 ++-- core/Lucy/Search/PolyQuery.cfh | 2 +- core/Lucy/Store/Folder.cfh | 2 +- core/Lucy/Store/Lock.cfh | 4 ++-- 8 files changed, 11 insertions(+), 11 deletions(-) diff --git a/core/Lucy/Index/IndexReader.cfh b/core/Lucy/Index/IndexReader.cfh index 442b5768f..96be62a6d 100644 --- a/core/Lucy/Index/IndexReader.cfh +++ b/core/Lucy/Index/IndexReader.cfh @@ -44,7 +44,7 @@ public class Lucy::Index::IndexReader nickname IxReader /** Abstract initializer. */ - public inert nullable IndexReader* + inert nullable IndexReader* init(IndexReader *self, Schema *schema = NULL, Folder *folder, Snapshot *snapshot = NULL, Vector *segments = NULL, int32_t seg_tick = -1, IndexManager *manager = NULL); diff --git a/core/Lucy/Index/Lexicon.cfh b/core/Lucy/Index/Lexicon.cfh index 301a0e6af..f643250ef 100644 --- a/core/Lucy/Index/Lexicon.cfh +++ b/core/Lucy/Index/Lexicon.cfh @@ -37,7 +37,7 @@ public class Lucy::Index::Lexicon nickname Lex inherits Clownfish::Obj { /** Abstract initializer. */ - public inert Lexicon* + inert Lexicon* init(Lexicon *self, String *field); public void diff --git a/core/Lucy/Index/PolyReader.cfh b/core/Lucy/Index/PolyReader.cfh index 6d362f8cc..4dd617b8f 100644 --- a/core/Lucy/Index/PolyReader.cfh +++ b/core/Lucy/Index/PolyReader.cfh @@ -58,13 +58,13 @@ public class Lucy::Index::PolyReader inherits Lucy::Index::IndexReader { /** Create a new PolyReader. */ - public inert incremented PolyReader* + inert incremented PolyReader* new(Schema *schema = NULL, Folder *folder, Snapshot *snapshot = NULL, IndexManager *manager = NULL, Vector *sub_readers = NULL); /** Initialize a PolyReader. */ - public inert PolyReader* + inert PolyReader* init(PolyReader *self, Schema *schema = NULL, Folder *folder, Snapshot *snapshot = NULL, IndexManager *manager = NULL, Vector *sub_readers = NULL); diff --git a/core/Lucy/Index/PostingList.cfh b/core/Lucy/Index/PostingList.cfh index fde9a7bc1..3429c97de 100644 --- a/core/Lucy/Index/PostingList.cfh +++ b/core/Lucy/Index/PostingList.cfh @@ -29,7 +29,7 @@ public class Lucy::Index::PostingList nickname PList /** Abstract initializer. */ - public inert PostingList* + inert PostingList* init(PostingList *self); /** Return the iterator's current Posting. Should not be called before diff --git a/core/Lucy/Index/Segment.cfh b/core/Lucy/Index/Segment.cfh index 778043804..218748579 100644 --- a/core/Lucy/Index/Segment.cfh +++ b/core/Lucy/Index/Segment.cfh @@ -42,12 +42,12 @@ public class Lucy::Index::Segment nickname Seg inherits Clownfish::Obj { /** Create a new Segment. */ - public inert incremented Segment* + inert incremented Segment* new(int64_t number); /** Initialize a segment. */ - public inert Segment* + inert Segment* init(Segment *self, int64_t number); /** Return a segment name with a base-36-encoded segment number. diff --git a/core/Lucy/Search/PolyQuery.cfh b/core/Lucy/Search/PolyQuery.cfh index b3c07d56e..69d026292 100644 --- a/core/Lucy/Search/PolyQuery.cfh +++ b/core/Lucy/Search/PolyQuery.cfh @@ -34,7 +34,7 @@ public abstract class Lucy::Search::PolyQuery inherits Lucy::Search::Query { * * @param children An array of child Queries. */ - public inert PolyQuery* + inert PolyQuery* init(PolyQuery *self, Vector *children = NULL); /** Add a child Query node. diff --git a/core/Lucy/Store/Folder.cfh b/core/Lucy/Store/Folder.cfh index f28306cba..4dc7ad58e 100644 --- a/core/Lucy/Store/Folder.cfh +++ b/core/Lucy/Store/Folder.cfh @@ -33,7 +33,7 @@ public abstract class Lucy::Store::Folder inherits Clownfish::Obj { /** Abstract initializer. */ - public inert nullable Folder* + inert nullable Folder* init(Folder *self, String *path); public void diff --git a/core/Lucy/Store/Lock.cfh b/core/Lucy/Store/Lock.cfh index d801a0c11..111a045e5 100644 --- a/core/Lucy/Store/Lock.cfh +++ b/core/Lucy/Store/Lock.cfh @@ -164,10 +164,10 @@ class Lucy::Store::LockFileLock nickname LFLock */ public class Lucy::Store::LockErr inherits Clownfish::Err { - public inert incremented LockErr* + inert incremented LockErr* new(String *message); - public inert LockErr* + inert LockErr* init(LockErr *self, String *message); } From 4ce89d7feead40c40c894f5d7dcbe3b1fd5c5585 Mon Sep 17 00:00:00 2001 From: Nick Wellnhofer Date: Thu, 11 Feb 2016 12:52:54 +0100 Subject: [PATCH 6/6] Fix method name in PolyReader POD --- perl/buildlib/Lucy/Build/Binding/Index.pm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/perl/buildlib/Lucy/Build/Binding/Index.pm b/perl/buildlib/Lucy/Build/Binding/Index.pm index 595d83841..3dc37b901 100644 --- a/perl/buildlib/Lucy/Build/Binding/Index.pm +++ b/perl/buildlib/Lucy/Build/Binding/Index.pm @@ -545,6 +545,10 @@ sub bind_polyreader { } END_SYNOPSIS $pod_spec->set_synopsis($synopsis); + $pod_spec->add_method( + method => 'Offsets', + alias => 'offsets', + ); my $xs_code = <<'END_XS_CODE'; MODULE = Lucy PACKAGE = Lucy::Index::PolyReader