null+****@clear*****
null+****@clear*****
2011年 8月 11日 (木) 00:46:36 JST
Kouhei Sutou 2011-08-10 15:46:36 +0000 (Wed, 10 Aug 2011)
New Revision: 93add416c707f5bc74fbf1d8ed470e49d92e6038
Log:
[doc][suggest] use correct output for embeded examples.
Added files:
doc/source/example/correction-1.log
Modified files:
doc/Makefile.am
doc/source/suggest/completion.txt
doc/source/suggest/correction.txt
doc/source/update_execution_example.py
Modified: doc/Makefile.am (+3 -1)
===================================================================
--- doc/Makefile.am 2011-08-10 15:22:54 +0000 (be1ba99)
+++ doc/Makefile.am 2011-08-10 15:46:36 +0000 (e1e23d7)
@@ -6,7 +6,9 @@ all:
include $(top_srcdir)/build/makefiles/sphinx-build.am
update-examples:
- GROONGA=$(GROONGA) $(srcdir)/source/update_execution_example.py
+ PATH=$(top_builddir)/src:$(top_builddir)/src/suggest:$$PATH \
+ $(srcdir)/source/update_execution_example.py \
+ $(srcdir)/source
man pdf clean-html:
for dir in $(SUBDIRS); do \
Added: doc/source/example/correction-1.log (+5 -0) 100644
===================================================================
--- /dev/null
+++ doc/source/example/correction-1.log 2011-08-10 15:46:36 +0000 (b91c44d)
@@ -0,0 +1,5 @@
+Execution example::
+
+ > suggest --table item_query --column kana --types correction --threshold 1 --query saerch
+ [[0,1312990993.62398,0.000350034],{"correct":[[1],[["_key","ShortText"],["_score","Int32"]],["search",2]]}]
+
\ No newline at end of file
Modified: doc/source/suggest/completion.txt (+4 -1)
===================================================================
--- doc/source/suggest/completion.txt 2011-08-10 15:22:54 +0000 (6389c7b)
+++ doc/source/suggest/completion.txt 2011-08-10 15:46:36 +0000 (fa5d664)
@@ -3,7 +3,10 @@
.. highlightlang:: none
.. groonga-command
-.. % groonga-suggest-create-dataset /tmp/example.db query
+.. % rm -rf /tmp/completion/db
+.. % mkdir -p /tmp/completion
+.. % groonga -n /tmp/completion/db shutdown
+.. % groonga-suggest-create-dataset /tmp/completion/db query
Completion
==========
Modified: doc/source/suggest/correction.txt (+4 -1)
===================================================================
--- doc/source/suggest/correction.txt 2011-08-10 15:22:54 +0000 (5ed749e)
+++ doc/source/suggest/correction.txt 2011-08-10 15:46:36 +0000 (34bbb98)
@@ -3,7 +3,10 @@
.. highlightlang:: none
.. groonga-command
-.. % groonga-suggest-create-dataset /tmp/example.db query
+.. % rm -rf /tmp/correction/db
+.. % mkdir -p /tmp/correction
+.. % groonga -n /tmp/correction/db shutdown
+.. % groonga-suggest-create-dataset /tmp/correction/db query
Correction
==========
Modified: doc/source/update_execution_example.py (+7 -3)
===================================================================
--- doc/source/update_execution_example.py 2011-08-10 15:22:54 +0000 (a0e3a62)
+++ doc/source/update_execution_example.py 2011-08-10 15:46:36 +0000 (3db329a)
@@ -5,6 +5,7 @@ from subprocess import *
from select import select
from sys import argv,stdout
import os
+import os.path
GROONGA_PATH = os.environ.get("GROONGA")
if GROONGA_PATH is None:
@@ -104,10 +105,13 @@ def readfile(fname, outflag):
print '###<<< include end'
-if len(argv) > 1:
- readfile(argv[1], 0)
+entry_point = "./"
+if len(argv) == 1:
+ entry_point = argv[1]
+if os.path.isfile(entry_point):
+ readfile(entry_point, 0)
else:
- for root, dirs, files in os.walk('./'):
+ for root, dirs, files in os.walk(entry_point):
for fname in files:
if fname.lower().endswith('.txt'):
b = os.path.join(root, fname)