Changeset 97564968f9aed076ddedd60a97b504b972e3f7fc
- Timestamp:
- 06/22/08 11:38:00 (7 months ago)
- Author:
- David Balmain <dbalmain@…>
- Parents:
- b82c99a2260ab756fe85d7b61da340581dc3b461
- Children:
- a249f609ee1784b37b8bce802dfa88406cc2c3fd
- git-committer:
- David Balmain <dbalmain@gmail.com> / 2008-06-22T11:38:00Z+1000
- Message:
-
Fixed ruby bindings and added Index#term_vector
* Added Index#term_vector method
* In Rakefile: need to use ln_sf instead of ln or we can't rebuild
* Added ext/scanner_utf8.c to .gitignore
* temporary fix to #define FRT_REALLOC_N REALLOC_N
- Location:
- ruby
- Files:
-
Legend:
- Unmodified
- Added
- Removed
-
|
r0c11a5
|
r975649
|
|
| 99 | 99 | ext/scanner.[ch] |
| 100 | 100 | ext/scanner_mb.c |
| | 101 | ext/scanner_utf8.c |
| 101 | 102 | ext/search.c |
| 102 | 103 | ext/search.h |
-
|
r88af92
|
r975649
|
|
| 84 | 84 | # prepend lib files to avoid conflicts |
| 85 | 85 | file dest_fn => fn do |t| |
| 86 | | ln fn, dest_fn |
| | 86 | ln_sf File.expand_path(fn), File.expand_path(dest_fn) |
| 87 | 87 | |
| 88 | 88 | if fn =~ /stemmer/ |
-
|
rb0a45e
|
r975649
|
|
| 14 | 14 | #define frt_ecalloc(n) xcalloc(n, 1) |
| 15 | 15 | #define frt_erealloc xrealloc |
| | 16 | /* FIXME: should eventually delete this */ |
| | 17 | #define FRT_REALLOC_N REALLOC_N |
| 16 | 18 | |
| 17 | 19 | |
-
|
r482d0e
|
r975649
|
|
| 480 | 480 | alias :[] :doc |
| 481 | 481 | |
| | 482 | # Retrieves the term_vector for a document. The document can be referenced |
| | 483 | # by either a string id to match the id field or an integer corresponding |
| | 484 | # to Ferret's document number. |
| | 485 | # |
| | 486 | # See Ferret::Index::IndexReader#term_vector |
| | 487 | def term_vector(id, field) |
| | 488 | @dir.synchronize do |
| | 489 | ensure_reader_open() |
| | 490 | if id.kind_of?(String) or id.kind_of?(Symbol) |
| | 491 | term_doc_enum = @reader.term_docs_for(@id_field, id.to_s) |
| | 492 | if term_doc_enum.next? |
| | 493 | id = @reader[term_doc_enum.doc] |
| | 494 | else |
| | 495 | return nil |
| | 496 | end |
| | 497 | end |
| | 498 | return @reader.term_vector(id, field) |
| | 499 | end |
| | 500 | end |
| | 501 | |
| 482 | 502 | # iterate through all documents in the index. This method preloads the |
| 483 | 503 | # documents so you don't need to call #load on the document to load all the |