[Groonga-commit] groonga/groonga at a70313e [master] doc time_classify_day_of_the_week: add

Back to archive index

Kouhei Sutou null+****@clear*****
Mon Jul 2 15:04:01 JST 2018


Kouhei Sutou	2018-07-02 15:04:01 +0900 (Mon, 02 Jul 2018)

  New Revision: a70313ecdd01c5fbf76be2a732602cd7340f6a16
  https://github.com/groonga/groonga/commit/a70313ecdd01c5fbf76be2a732602cd7340f6a16

  Message:
    doc time_classify_day_of_the_week: add

  Added files:
    doc/source/example/reference/functions/time_classify_day_of_the_week/usage_classify.log
    doc/source/example/reference/functions/time_classify_day_of_the_week/usage_register.log
    doc/source/example/reference/functions/time_classify_day_of_the_week/usage_setup_data.log
    doc/source/example/reference/functions/time_classify_day_of_the_week/usage_setup_schema.log
    doc/source/reference/functions/time_classify_day_of_the_week.rst
  Modified files:
    doc/files.am
    doc/locale/ja/LC_MESSAGES/reference.po
    doc/source/reference/functions/vector_find.rst

  Modified: doc/files.am (+11 -0)
===================================================================
--- doc/files.am    2018-07-02 14:36:33 +0900 (0b66c8286)
+++ doc/files.am    2018-07-02 15:04:01 +0900 (72e3f42d9)
@@ -428,6 +428,10 @@ absolute_source_files = \
 	$(top_srcdir)/doc/source/example/reference/functions/sub_filter/usage_setup_schema.log \
 	$(top_srcdir)/doc/source/example/reference/functions/sub_filter/usage_with_sub_filter.log \
 	$(top_srcdir)/doc/source/example/reference/functions/sub_filter/usage_without_sub_filter.log \
+	$(top_srcdir)/doc/source/example/reference/functions/time_classify_day_of_the_week/usage_classify.log \
+	$(top_srcdir)/doc/source/example/reference/functions/time_classify_day_of_the_week/usage_register.log \
+	$(top_srcdir)/doc/source/example/reference/functions/time_classify_day_of_the_week/usage_setup_data.log \
+	$(top_srcdir)/doc/source/example/reference/functions/time_classify_day_of_the_week/usage_setup_schema.log \
 	$(top_srcdir)/doc/source/example/reference/functions/vector_find/usage_find.log \
 	$(top_srcdir)/doc/source/example/reference/functions/vector_find/usage_find_mode.log \
 	$(top_srcdir)/doc/source/example/reference/functions/vector_find/usage_register.log \
@@ -888,6 +892,7 @@ absolute_source_files = \
 	$(top_srcdir)/doc/source/reference/functions/string_substring.rst \
 	$(top_srcdir)/doc/source/reference/functions/sub_filter.rst \
 	$(top_srcdir)/doc/source/reference/functions/time_classify_day.rst \
+	$(top_srcdir)/doc/source/reference/functions/time_classify_day_of_the_week.rst \
 	$(top_srcdir)/doc/source/reference/functions/time_classify_hour.rst \
 	$(top_srcdir)/doc/source/reference/functions/time_classify_minute.rst \
 	$(top_srcdir)/doc/source/reference/functions/time_classify_month.rst \
@@ -1401,6 +1406,10 @@ source_files_relative_from_doc_dir = \
 	source/example/reference/functions/sub_filter/usage_setup_schema.log \
 	source/example/reference/functions/sub_filter/usage_with_sub_filter.log \
 	source/example/reference/functions/sub_filter/usage_without_sub_filter.log \
+	source/example/reference/functions/time_classify_day_of_the_week/usage_classify.log \
+	source/example/reference/functions/time_classify_day_of_the_week/usage_register.log \
+	source/example/reference/functions/time_classify_day_of_the_week/usage_setup_data.log \
+	source/example/reference/functions/time_classify_day_of_the_week/usage_setup_schema.log \
 	source/example/reference/functions/vector_find/usage_find.log \
 	source/example/reference/functions/vector_find/usage_find_mode.log \
 	source/example/reference/functions/vector_find/usage_register.log \
@@ -1861,6 +1870,7 @@ source_files_relative_from_doc_dir = \
 	source/reference/functions/string_substring.rst \
 	source/reference/functions/sub_filter.rst \
 	source/reference/functions/time_classify_day.rst \
+	source/reference/functions/time_classify_day_of_the_week.rst \
 	source/reference/functions/time_classify_hour.rst \
 	source/reference/functions/time_classify_minute.rst \
 	source/reference/functions/time_classify_month.rst \
@@ -2267,6 +2277,7 @@ html_files_relative_from_locale_dir = \
 	html/reference/functions/string_substring.html \
 	html/reference/functions/sub_filter.html \
 	html/reference/functions/time_classify_day.html \
+	html/reference/functions/time_classify_day_of_the_week.html \
 	html/reference/functions/time_classify_hour.html \
 	html/reference/functions/time_classify_minute.html \
 	html/reference/functions/time_classify_month.html \

  Modified: doc/locale/ja/LC_MESSAGES/reference.po (+58 -2)
===================================================================
--- doc/locale/ja/LC_MESSAGES/reference.po    2018-07-02 14:36:33 +0900 (c3eba8310)
+++ doc/locale/ja/LC_MESSAGES/reference.po    2018-07-02 15:04:01 +0900 (5e589ec0b)
@@ -7,7 +7,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: 1.2.1\n"
 "Report-Msgid-Bugs-To: \n"
-"PO-Revision-Date: 2018-06-28 12:46+0900\n"
+"PO-Revision-Date: 2018-07-02 15:03+0900\n"
 "Last-Translator: Masafumi Yokoyama <yokoyama �� clear-code.com>\n"
 "Language-Team: Japanese\n"
 "Language: ja\n"
@@ -5651,7 +5651,7 @@ msgid "The type of the column. It is one of the followings:"
 msgstr "カラムの型。次のうちのどれかです。"
 
 msgid "Value"
-msgstr ""
+msgstr "値"
 
 msgid "``fix``"
 msgstr ""
@@ -21065,6 +21065,62 @@ msgstr ""
 msgid "``time_classify_day``"
 msgstr ""
 
+msgid "``time_classify_day_of_the_week``"
+msgstr ""
+
+msgid ""
+"It returns the day of the week of the given time as a ``UInt8`` value. ``0`` "
+"is Sunday. ``6`` is Saturday."
+msgstr ""
+"指定された時刻の曜日を ``UInt8`` の値として返します。 ``0`` は日曜日で、 "
+"``6`` は土曜日です。"
+
+msgid ""
+"To enable this function, register ``functions/time`` plugin by the following "
+"command::"
+msgstr ""
+"この関数を有効にするには、以下のコマンドで ``functions/time`` プラグインを登"
+"録します。::"
+
+msgid "You need to register ``functions/time`` plugin at first:"
+msgstr "まず ``functions/time`` プラグインを登録します。"
+
+msgid "Here is a simple usage of ``time_classify_day_of_the_week``:"
+msgstr "以下は簡単な ``time_classify_day_of_the_week`` の使用例です。"
+
+msgid ""
+"It returns ``0`` for Sunday, ``1`` for Monday, ... and ``6`` for Saturday."
+msgstr ""
+"日曜日の場合は ``0`` 、月曜日の場合は ``1`` …、土曜日の場合は ``6`` を返しま"
+"す。"
+
+msgid "The day of the week as ``UInt8``. Here are available values:"
+msgstr "``UInt8`` で表現した曜日。有効な値は次の通りです。"
+
+msgid "The day of the week"
+msgstr "曜日"
+
+msgid "Sunday"
+msgstr "日曜日"
+
+msgid "Monday"
+msgstr "月曜日"
+
+msgid "Tuesday"
+msgstr "火曜日"
+
+msgid "Wednesday"
+msgstr "水曜日"
+
+msgid "Thursday"
+msgstr "木曜日"
+
+msgid "Friday"
+msgstr "金曜日"
+
+msgid "Saturday"
+msgstr "土曜日"
+
 msgid "``time_classify_hour``"
 msgstr ""
 

  Added: doc/source/example/reference/functions/time_classify_day_of_the_week/usage_classify.log (+57 -0) 100644
===================================================================
--- /dev/null
+++ doc/source/example/reference/functions/time_classify_day_of_the_week/usage_classify.log    2018-07-02 15:04:01 +0900 (bb4dbbbc5)
@@ -0,0 +1,57 @@
+Execution example::
+
+  select \
+    --table Memos \
+    --output_columns '_key, time_classify_day_of_the_week(created_at)'
+  # [
+  #   [
+  #     0, 
+  #     1337566253.89858, 
+  #     0.000355720520019531
+  #   ], 
+  #   [
+  #     [
+  #       [
+  #         7
+  #       ], 
+  #       [
+  #         [
+  #           "_key", 
+  #           "ShortText"
+  #         ], 
+  #         [
+  #           "time_classify_day_of_the_week", 
+  #           null
+  #         ]
+  #       ], 
+  #       [
+  #         "Sunday", 
+  #         0
+  #       ], 
+  #       [
+  #         "Monday", 
+  #         1
+  #       ], 
+  #       [
+  #         "Tuesday", 
+  #         2
+  #       ], 
+  #       [
+  #         "Wednesday", 
+  #         3
+  #       ], 
+  #       [
+  #         "Thursday", 
+  #         4
+  #       ], 
+  #       [
+  #         "Friday", 
+  #         5
+  #       ], 
+  #       [
+  #         "Saturday", 
+  #         6
+  #       ]
+  #     ]
+  #   ]
+  # ]

  Added: doc/source/example/reference/functions/time_classify_day_of_the_week/usage_register.log (+4 -0) 100644
===================================================================
--- /dev/null
+++ doc/source/example/reference/functions/time_classify_day_of_the_week/usage_register.log    2018-07-02 15:04:01 +0900 (dd40a3622)
@@ -0,0 +1,4 @@
+Execution example::
+
+  plugin_register functions/time
+  # [[0, 1337566253.89858, 0.000355720520019531], true]

  Added: doc/source/example/reference/functions/time_classify_day_of_the_week/usage_setup_data.log (+13 -0) 100644
===================================================================
--- /dev/null
+++ doc/source/example/reference/functions/time_classify_day_of_the_week/usage_setup_data.log    2018-07-02 15:04:01 +0900 (24091f79c)
@@ -0,0 +1,13 @@
+Execution example::
+
+  load --table Memos
+  [
+  {"_key": "Sunday",    "created_at": "2018-07-01 00:00:00"},
+  {"_key": "Monday",    "created_at": "2018-07-02 00:00:00"},
+  {"_key": "Tuesday",   "created_at": "2018-07-03 00:00:00"},
+  {"_key": "Wednesday", "created_at": "2018-07-04 00:00:00"},
+  {"_key": "Thursday",  "created_at": "2018-07-05 00:00:00"},
+  {"_key": "Friday",    "created_at": "2018-07-06 00:00:00"},
+  {"_key": "Saturday",  "created_at": "2018-07-07 00:00:00"}
+  ]
+  # [[0, 1337566253.89858, 0.000355720520019531], 7]

  Added: doc/source/example/reference/functions/time_classify_day_of_the_week/usage_setup_schema.log (+6 -0) 100644
===================================================================
--- /dev/null
+++ doc/source/example/reference/functions/time_classify_day_of_the_week/usage_setup_schema.log    2018-07-02 15:04:01 +0900 (e0bf0ca57)
@@ -0,0 +1,6 @@
+Execution example::
+
+  table_create  Memos TABLE_HASH_KEY ShortText
+  # [[0, 1337566253.89858, 0.000355720520019531], true]
+  column_create Memos created_at COLUMN_SCALAR Time
+  # [[0, 1337566253.89858, 0.000355720520019531], true]

  Added: doc/source/reference/functions/time_classify_day_of_the_week.rst (+100 -0) 100644
===================================================================
--- /dev/null
+++ doc/source/reference/functions/time_classify_day_of_the_week.rst    2018-07-02 15:04:01 +0900 (29152045e)
@@ -0,0 +1,100 @@
+.. -*- rst -*-
+
+.. highlightlang:: none
+
+.. groonga-command
+.. database: functions_time_classify_day_of_the_week
+
+``time_classify_day_of_the_week``
+=================================
+
+Summary
+-------
+
+.. versionadded:: 8.0.5
+
+It returns the day of the week of the given time as a ``UInt8``
+value. ``0`` is Sunday. ``6`` is Saturday.
+
+To enable this function, register ``functions/time`` plugin by the
+following command::
+
+  plugin_register functions/time
+
+.. _time-classify-day-of-the-week-syntax:
+
+Syntax
+------
+
+This function has only one parameter::
+
+  time_classify_day_of_the_week(time)
+
+Usage
+-----
+
+You need to register ``functions/time`` plugin at first:
+
+.. groonga-command
+.. include:: ../../example/reference/functions/time_classify_day_of_the_week/usage_register.log
+.. plugin_register functions/time
+
+Here is a schema definition and sample data.
+
+Sample schema:
+
+.. groonga-command
+.. include:: ../../example/reference/functions/time_classify_day_of_the_week/usage_setup_schema.log
+.. table_create  Memos TABLE_HASH_KEY ShortText
+.. column_create Memos created_at COLUMN_SCALAR Time
+
+Sample data:
+
+.. groonga-command
+.. include:: ../../example/reference/functions/time_classify_day_of_the_week/usage_setup_data.log
+.. load --table Memos
+.. [
+.. {"_key": "Sunday",    "created_at": "2018-07-01 00:00:00"},
+.. {"_key": "Monday",    "created_at": "2018-07-02 00:00:00"},
+.. {"_key": "Tuesday",   "created_at": "2018-07-03 00:00:00"},
+.. {"_key": "Wednesday", "created_at": "2018-07-04 00:00:00"},
+.. {"_key": "Thursday",  "created_at": "2018-07-05 00:00:00"},
+.. {"_key": "Friday",    "created_at": "2018-07-06 00:00:00"},
+.. {"_key": "Saturday",  "created_at": "2018-07-07 00:00:00"}
+.. ]
+
+Here is a simple usage of ``time_classify_day_of_the_week``:
+
+.. groonga-command
+.. include:: ../../example/reference/functions/time_classify_day_of_the_week/usage_classify.log
+.. select \
+..   --table Memos \
+..   --output_columns '_key, time_classify_day_of_the_week(created_at)'
+
+It returns ``0`` for Sunday, ``1`` for Monday, ... and ``6`` for
+Saturday.
+
+Return value
+------------
+
+The day of the week as ``UInt8``. Here are available values:
+
+.. list-table::
+   :header-rows: 1
+
+   * - Value
+     - The day of the week
+   * - ``0``
+     - Sunday
+   * - ``1``
+     - Monday
+   * - ``2``
+     - Tuesday
+   * - ``3``
+     - Wednesday
+   * - ``4``
+     - Thursday
+   * - ``5``
+     - Friday
+   * - ``6``
+     - Saturday

  Modified: doc/source/reference/functions/vector_find.rst (+2 -2)
===================================================================
--- doc/source/reference/functions/vector_find.rst    2018-07-02 14:36:33 +0900 (9bcd1794d)
+++ doc/source/reference/functions/vector_find.rst    2018-07-02 15:04:01 +0900 (99d6f90b7)
@@ -31,8 +31,8 @@ Syntax
 
 ``vector_find`` has two or three parameters::
 
-  vector_find(vector, value);
-  vector_find(vector, value, mode);
+  vector_find(vector, value)
+  vector_find(vector, value, mode)
 
 If you omit the third argument, each element in the ``vector`` is
 compared with ``value`` by equality comparison.
-------------- next part --------------
HTML����������������������������...
URL: https://lists.osdn.me/mailman/archives/groonga-commit/attachments/20180702/2dc18710/attachment-0001.htm 



More information about the Groonga-commit mailing list
Back to archive index