{ "cells": [ { "cell_type": "code", "execution_count": 52, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "(Dict(\"イカ\"=>1,\"梨\"=>3,\"リンゴ\"=>2,\"蜜柑\"=>1), Dict(\"マグロ\"=>2,\"サーモン\"=>1,\"鯖\"=>2,\"うなぎ\"=>2), Dict(\"鰹\"=>1,\"昆布\"=>3,\"梅\"=>2,\"めんたいこ\"=>1))" ] }, "execution_count": 52, "metadata": {}, "output_type": "execute_result" } ], "source": [ "α = 0.5\n", "β = 0.8\n", "z = 0.6\n", "\n", "d = Dict(\"リンゴ\"=>2,\"梨\"=>3,\"蜜柑\"=>1,\"イカ\"=>1),Dict(\"うなぎ\"=>2,\"マグロ\"=>2,\"鯖\"=>2,\"サーモン\"=>1),Dict(\"めんたいこ\"=>1,\"昆布\"=>3,\"鰹\"=>1,\"梅\"=>2)\n", "#d2 = Dict(\"うなぎ\"=>2,\"マグロ\"=>2,\"鯖\"=>2,\"サーモン\"=>1)\n", "#d3 = Dict(\"めんたいこ\"=>1,\"昆布\"=>3,\"鰹\"=>1,\"梅\"=>2)" ] }, { "cell_type": "code", "execution_count": 54, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "4" ] }, "execution_count": 54, "metadata": {}, "output_type": "execute_result" } ], "source": [ "length(d[1])" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# 文書のサンプル数\n", "for s in 1:3\n", " # 全文書の数\n", " for doc in d\n", " # 文書dの単語数\n", " for i in 1:length(doc)\n", " \n", " end\n", " end\n", "end" ] } ], "metadata": { "kernelspec": { "display_name": "Julia 0.6.3", "language": "julia", "name": "julia-0.6" }, "language_info": { "file_extension": ".jl", "mimetype": "application/julia", "name": "julia", "version": "0.6.3" } }, "nbformat": 4, "nbformat_minor": 2 }