{"id":1612,"date":"2012-11-15T09:00:00","date_gmt":"2012-11-15T08:00:00","guid":{"rendered":"https:\/\/www.couchbase.com\/blog\/?p=1612"},"modified":"2017-03-01T07:39:01","modified_gmt":"2017-03-01T15:39:01","slug":"fun-couchbase-and-markov-chains","status":"publish","type":"post","link":"https:\/\/www.couchbase.com\/blog\/pt\/fun-couchbase-and-markov-chains\/","title":{"rendered":"Divers\u00e3o com o Couchbase e as cadeias de Markov"},"content":{"rendered":"<p>Tenho ouvido falar sobre <a href=\"https:\/\/en.wikipedia.org\/wiki\/Markov_chain\">Cadeias de Markov<\/a> J\u00e1 estava na hora de aprender mais sobre elas e desenvolver um aplicativo simples e divertido de cadeia de Markov. Tenho certeza de que voc\u00ea n\u00e3o quer ficar atolado nos detalhes matem\u00e1ticos das cadeias de Markov - aprender criando um aplicativo \u00e9 onde est\u00e1 a divers\u00e3o!<\/p>\n<p dir=\"ltr\">Neste blog, mostraremos como criar um aplicativo <strong>\"Marky\"<\/strong> que usa cadeias de Markov para gerar tweets sem sentido com base em seu hist\u00f3rico no Twitter. Ele usa o Couchbase Server para armazenar e processar os dados para gerar esses tweets.<\/p>\n<p><strong>A Marky usa o Couchbase Server <a href=\"https:\/\/www.couchbase.com\/blog\/pt\/docs\/couchbase-manual-2.0\/couchbase-views.html\/\">visualiza\u00e7\u00f5es<\/a> para processar dados<\/strong><br \/>A fun\u00e7\u00e3o de mapa do Marky \u00e9 :<\/p>\n<div class=\"geshifilter\">\n<div class=\"javascript geshifilter-javascript\" style=\"font-family:monospace;\"><span style=\"color: #003366; font-weight: bold;\">fun\u00e7\u00e3o<\/span> <span style=\"color: #009900;\">(<\/span>doc<span style=\"color: #339933;\">,<\/span> meta<span style=\"color: #009900;\">)<\/span> <span style=\"color: #009900;\">{<\/span><br \/>\u00a0 \u00a0<span style=\"color: #000066; font-weight: bold;\">se<\/span><span style=\"color: #009900;\">(<\/span>doc.<span style=\"color: #660066;\">corpo<\/span><span style=\"color: #009900;\">)<\/span> <span style=\"color: #009900;\">{<\/span><br \/>\u00a0 \u00a0 \u00a0 \u00a0<span style=\"color: #003366; font-weight: bold;\">var<\/span> palavras <span style=\"color: #339933;\">=<\/span> doc.<span style=\"color: #660066;\">corpo<\/span>.<span style=\"color: #660066;\">dividir<\/span><span style=\"color: #009900;\">(<\/span><span style=\"color: #009966; font-style: italic;\">\/s+\/<\/span><span style=\"color: #009900;\">)<\/span><span style=\"color: #339933;\">;<\/span><br \/>\u00a0 \u00a0 \u00a0 \u00a0<span style=\"color: #000066; font-weight: bold;\">se<\/span> <span style=\"color: #009900;\">(<\/span>palavras.<span style=\"color: #660066;\">comprimento<\/span> <span style=\"color: #339933;\">>=<\/span> <span style=\"color: #CC0000;\">1<\/span><span style=\"color: #009900;\">)<\/span> <span style=\"color: #009900;\">{<\/span><br \/>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0emitir<span style=\"color: #009900;\">(<\/span><span style=\"color: #009900;\">[<\/span><span style=\"color: #003366; font-weight: bold;\">nulo<\/span><span style=\"color: #339933;\">,<\/span> palavras<span style=\"color: #009900;\">[<\/span><span style=\"color: #CC0000;\">0<\/span><span style=\"color: #009900;\">]<\/span><span style=\"color: #009900;\">]<\/span><span style=\"color: #339933;\">,<\/span> <span style=\"color: #CC0000;\">1<\/span><span style=\"color: #009900;\">)<\/span><span style=\"color: #339933;\">;<\/span><br \/>\u00a0 \u00a0 \u00a0 \u00a0<span style=\"color: #009900;\">}<\/span><br \/>\u00a0 \u00a0 \u00a0 \u00a0<span style=\"color: #000066; font-weight: bold;\">para<\/span><span style=\"color: #009900;\">(<\/span><span style=\"color: #003366; font-weight: bold;\">var<\/span> i <span style=\"color: #339933;\">=<\/span> <span style=\"color: #CC0000;\">0<\/span><span style=\"color: #339933;\">;<\/span> i <span style=\"color: #339933;\"><<\/span> <span style=\"color: #009900;\">(<\/span>palavras.<span style=\"color: #660066;\">comprimento<\/span> <span style=\"color: #339933;\">&#8211;<\/span> <span style=\"color: #CC0000;\">1<\/span><span style=\"color: #009900;\">)<\/span><span style=\"color: #339933;\">;<\/span> i<span style=\"color: #339933;\">++<\/span><span style=\"color: #009900;\">)<\/span> <span style=\"color: #009900;\">{<\/span><br \/>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0<span style=\"color: #003366; font-weight: bold;\">var<\/span> par <span style=\"color: #339933;\">=<\/span> <span style=\"color: #009900;\">[<\/span>palavras<span style=\"color: #009900;\">[<\/span>i<span style=\"color: #009900;\">]<\/span><span style=\"color: #339933;\">,<\/span> palavras<span style=\"color: #009900;\">[<\/span>i<span style=\"color: #339933;\">+<\/span><span style=\"color: #CC0000;\">1<\/span><span style=\"color: #009900;\">]<\/span><span style=\"color: #009900;\">]<\/span><span style=\"color: #339933;\">;<\/span><br \/>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0emitir<span style=\"color: #009900;\">(<\/span>par<span style=\"color: #339933;\">,<\/span> <span style=\"color: #CC0000;\">1<\/span><span style=\"color: #009900;\">)<\/span><span style=\"color: #339933;\">;<\/span><br \/>\u00a0 \u00a0 \u00a0 \u00a0<span style=\"color: #009900;\">}<\/span><br \/>\u00a0 \u00a0<span style=\"color: #009900;\">}<\/span><br \/><span style=\"color: #009900;\">}<\/span><\/div>\n<\/div>\n<p>Em um n\u00edvel mais alto, ele divide o texto em peda\u00e7os menores usando uma janela deslizante sobre duas palavras consecutivas e tenta reagrupar esses peda\u00e7os na ordem correta para formar frases com base em um peso estat\u00edstico. No final, voc\u00ea obt\u00e9m um texto sem sentido que \u00e9 divertido de ler.<\/p>\n<p>Por exemplo: dado o texto de entrada \"In this blog, we will show you how to build an application\" (Neste blog, mostraremos como criar um aplicativo), ele emitir\u00e1 os pares Key,Value -<\/p>\n<div class=\"geshifilter\">\n<div class=\"text geshifilter-text\" style=\"font-family:monospace;\">Valor-chave<\/p>\n<p>[null, \"In\"] 1<br \/>[\"In\", \"this\"] 1<br \/>[\"this\", \"blog,\"] 1<br \/>[\"blog,\", \"we\"] 1<br \/>[\"we\", \"will\"] 1<br \/>[\"will\", \"show\"] 1<br \/>[\"show\", \"you\"] 1<br \/>[\"you\", \"how\"] 1<br \/>[\"how\", \"to\"] 1<br \/>[\"to\", \"build\"] 1<br \/>[\"build\", \"an\"] 1<br \/>[\"an\", \"application\"] 1<\/div>\n<\/div>\n<p dir=\"ltr\">Para gerar uma palavra, consultamos a exibi\u00e7\u00e3o usando a \u00faltima palavra que produzimos. Por exemplo, para obter candidatos a uma palavra ap\u00f3s \"the\", usamos os par\u00e2metros de consulta startkey=[\"the\"]&amp;endkey=[\"the\",{}]&amp;group_level=2&amp;reduce=true<\/p>\n<p dir=\"ltr\">Isso obter\u00e1 todos os pares de palavras que produzimos que come\u00e7am com \"the\", agrupar\u00e1 os pares que s\u00e3o iguais e executar\u00e1 a fun\u00e7\u00e3o reduce da visualiza\u00e7\u00e3o em cada grupo. O Marky usa o reduce _sum incorporado, que somar\u00e1 os valores que lhe forem fornecidos. A execu\u00e7\u00e3o desse procedimento no banco de dados que faz o backup de dkatz_ebooks produz:<\/p>\n<div class=\"geshifilter\">\n<div class=\"text geshifilter-text\" style=\"font-family:monospace;\">Valor-chave<br \/>[\"o\", \"#1\u2033] 1<br \/>[\"o\", \"100\u2033] 1<br \/>[\"o\", \"2\u2033] 1<br \/>[\"the\", \"ability\"] 3<br \/>[\"the\", \"absolute\"] 1<br \/>[\"the\", \"answer\"] 1<br \/>[\"o\", \"aplicativo\"] 1<br \/>[\"o\", \"aplicativo\"] 1<br \/>[\"a\", \"\u00e1rea,\"] 1<br \/>[\"the\", \"background.\"] 1<\/div>\n<\/div>\n<p>Para escolher a palavra a ser emitida ap\u00f3s \"the\", escolhemos uma palavra que a segue aleatoriamente, mas ponderamos nossa escolha com base na frequ\u00eancia do par de palavras que aparece na entrada. Isso significa que damos a \"ability\" uma chance de 3\/12 ou 25% de ser escolhida aqui, enquanto o restante das palavras tem uma chance de 1\/12 de ser escolhida ou 8,3%.<\/p>\n<p dir=\"ltr\">Como no in\u00edcio de uma frase, emparelhamos a primeira palavra com nulo (por exemplo: [null, \"In\"] no exemplo anterior), podemos fazer a mesma consulta com nulo para iniciar uma nova sa\u00edda e obter palavras que provavelmente iniciar\u00e3o um pensamento, um tweet ou qualquer que seja a nossa entrada. Tamb\u00e9m precisamos fazer isso se n\u00e3o tivermos sorte e n\u00e3o recebermos nenhuma palavra candidata da primeira consulta de visualiza\u00e7\u00e3o. Isso pode acontecer se a palavra na consulta tiver aparecido apenas no final dos textos de entrada que processamos.<\/p>\n<p><\/p>\n<p><strong>Aplicativo Marky<\/strong><\/p>\n<p dir=\"ltr\">Marky usa um <a href=\"https:\/\/github.com\/apage43\/cbdrawer\">wrapper simples do clojure<\/a> criado pela comunidade. Para configurar o marky, crie um arquivo marky-config.clj e aponte-o para o cluster do Couchbase Server e a conta do Twitter. Adicione alguns dados de semente, contas de usu\u00e1rio do Twitter ou feeds at\u00f4micos e voc\u00ea estar\u00e1 pronto para iniciar o aplicativo.<\/p>\n<p><\/p>\n<div class=\"geshifilter\">\n<div class=\"text geshifilter-text\" style=\"font-family:monospace;\">{:bucket \"default\"<br \/>:pass \"\"<br \/>:cburl \"https:\/\/localhost:8091\/\"<br \/>:twitter {:app-key \"XXXXXXXXX\"<br \/>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 segredo do aplicativo \"XXXXXXXXXX\"<br \/>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 token de usu\u00e1rio \"XXXXXXXX\"<br \/>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 :user-secret \"XXXXXXXX\"}<br \/>:jobs<br \/>[; :period, :after est\u00e3o em segundos, :ttl est\u00e1 em dias.<br \/>\u00a0{:type :twitter :user \"user-handle1\" :period 3600 :ttl 60}<br \/>\u00a0{:type :twitter :user \"user-handle2\" :period 3600 :ttl 60}<br \/>\u00a0{:type :send-tweet :period 3600 :after 600}<br \/>\u00a0{:type :atom :url \"https:\/\/some-domain\/rssfeed.php\" :period 86400 :ttl 60}]}<\/div>\n<\/div>\n<p>Aqui est\u00e3o alguns tweets divertidos do Marky<\/p>\n<p><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.couchbase.com\/blog\/sites\/default\/files\/uploads\/all\/Screen%20Shot%202012-11-15%20at%2012.24.14%20PM.png\" style=\"width:529px;height:100px;\" \/><\/p>\n<p><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.couchbase.com\/blog\/sites\/default\/files\/uploads\/all\/Screen%20Shot%202012-11-15%20at%2012.36.41%20PM.png\" style=\"width:530px;height:114px;\" \/><\/p>\n<p><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.couchbase.com\/blog\/sites\/default\/files\/uploads\/all\/Screen%20Shot%202012-11-15%20at%2012.41.21%20PM.png\" style=\"width:530px;height:93px;\" \/><\/p>\n<p><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.couchbase.com\/blog\/sites\/default\/files\/uploads\/all\/Screen%20Shot%202012-11-15%20at%2012.41.46%20PM.png\" style=\"width:530px;height:113px;\" \/><\/p>\n<p>Quer ficar com o Marky?<\/p>\n<p>Voc\u00ea pode fazer o download do c\u00f3digo-fonte do Marky <a href=\"https:\/\/github.com\/couchbaselabs\/marky\">aqui<\/a><br \/>Voc\u00ea tamb\u00e9m pode contribuir com o projeto clojure wrapper <a href=\"https:\/\/github.com\/apage43\/cbdrawer\">aqui<\/a><\/p>\n<p>Divirta-se!<\/p>\n<p>&#8212;-<\/p>\n<p>Agradecemos a Aaron por ter elaborado o c\u00f3digo em clojure.<\/p>","protected":false},"excerpt":{"rendered":"<p>I\u2019ve been hearing about Markov chains for long enough \u2013 it was time that I learned more about them and develop a simple fun markov chain application. I\u2019m sure that you don\u2019t want to get bogged down by the mathematical [&hellip;]<\/p>","protected":false},"author":2,"featured_media":13873,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"categories":[1],"tags":[],"ppma_author":[8968],"class_list":["post-1612","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v26.2 (Yoast SEO v26.2) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Fun with Couchbase and Markov Chains - The Couchbase Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.couchbase.com\/blog\/pt\/fun-couchbase-and-markov-chains\/\" \/>\n<meta property=\"og:locale\" content=\"pt_BR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Fun with Couchbase and Markov Chains\" \/>\n<meta property=\"og:description\" content=\"I\u2019ve been hearing about Markov chains for long enough \u2013 it was time that I learned more about them and develop a simple fun markov chain application. I\u2019m sure that you don\u2019t want to get bogged down by the mathematical [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.couchbase.com\/blog\/pt\/fun-couchbase-and-markov-chains\/\" \/>\n<meta property=\"og:site_name\" content=\"The Couchbase Blog\" \/>\n<meta property=\"article:published_time\" content=\"2012-11-15T08:00:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2017-03-01T15:39:01+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2022\/11\/couchbase-nosql-dbaas.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1800\" \/>\n\t<meta property=\"og:image:height\" content=\"630\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"The Couchbase Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"The Couchbase Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minuto\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/fun-couchbase-and-markov-chains\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/fun-couchbase-and-markov-chains\/\"},\"author\":{\"name\":\"The Couchbase Team\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/764f4a6771ee19bc7af70b70a326fb93\"},\"headline\":\"Fun with Couchbase and Markov Chains\",\"datePublished\":\"2012-11-15T08:00:00+00:00\",\"dateModified\":\"2017-03-01T15:39:01+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/fun-couchbase-and-markov-chains\/\"},\"wordCount\":138,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/fun-couchbase-and-markov-chains\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png\",\"articleSection\":[\"Uncategorized\"],\"inLanguage\":\"pt-BR\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.couchbase.com\/blog\/fun-couchbase-and-markov-chains\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/fun-couchbase-and-markov-chains\/\",\"url\":\"https:\/\/www.couchbase.com\/blog\/fun-couchbase-and-markov-chains\/\",\"name\":\"Fun with Couchbase and Markov Chains - The Couchbase Blog\",\"isPartOf\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/fun-couchbase-and-markov-chains\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/fun-couchbase-and-markov-chains\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png\",\"datePublished\":\"2012-11-15T08:00:00+00:00\",\"dateModified\":\"2017-03-01T15:39:01+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/fun-couchbase-and-markov-chains\/#breadcrumb\"},\"inLanguage\":\"pt-BR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.couchbase.com\/blog\/fun-couchbase-and-markov-chains\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"pt-BR\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/fun-couchbase-and-markov-chains\/#primaryimage\",\"url\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png\",\"contentUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png\",\"width\":1800,\"height\":630},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/fun-couchbase-and-markov-chains\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.couchbase.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Fun with Couchbase and Markov Chains\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#website\",\"url\":\"https:\/\/www.couchbase.com\/blog\/\",\"name\":\"The Couchbase Blog\",\"description\":\"Couchbase, the NoSQL Database\",\"publisher\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.couchbase.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"pt-BR\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#organization\",\"name\":\"The Couchbase Blog\",\"url\":\"https:\/\/www.couchbase.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"pt-BR\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/04\/admin-logo.png\",\"contentUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/04\/admin-logo.png\",\"width\":218,\"height\":34,\"caption\":\"The Couchbase Blog\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/764f4a6771ee19bc7af70b70a326fb93\",\"name\":\"The Couchbase Team\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"pt-BR\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/image\/7befc37d02226b59499817eafdec60c3\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/b4c18c758421903398e84d6c9560f319f39c665798d7d23e6a6f9dff8a8f984e?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/b4c18c758421903398e84d6c9560f319f39c665798d7d23e6a6f9dff8a8f984e?s=96&d=mm&r=g\",\"caption\":\"The Couchbase Team\"},\"description\":\"Jennifer Garcia is a Senior Web Manager at Couchbase Inc. As the website manager, Jennifer has overall responsibility for the website properties including design, implementation, content, and performance.\",\"sameAs\":[\"https:\/\/www.couchbase.com\"],\"url\":\"https:\/\/www.couchbase.com\/blog\/pt\/author\/jennifer-garcia\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Fun with Couchbase and Markov Chains - The Couchbase Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.couchbase.com\/blog\/pt\/fun-couchbase-and-markov-chains\/","og_locale":"pt_BR","og_type":"article","og_title":"Fun with Couchbase and Markov Chains","og_description":"I\u2019ve been hearing about Markov chains for long enough \u2013 it was time that I learned more about them and develop a simple fun markov chain application. I\u2019m sure that you don\u2019t want to get bogged down by the mathematical [&hellip;]","og_url":"https:\/\/www.couchbase.com\/blog\/pt\/fun-couchbase-and-markov-chains\/","og_site_name":"The Couchbase Blog","article_published_time":"2012-11-15T08:00:00+00:00","article_modified_time":"2017-03-01T15:39:01+00:00","og_image":[{"width":1800,"height":630,"url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2022\/11\/couchbase-nosql-dbaas.png","type":"image\/png"}],"author":"The Couchbase Team","twitter_card":"summary_large_image","twitter_misc":{"Written by":"The Couchbase Team","Est. reading time":"1 minuto"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.couchbase.com\/blog\/fun-couchbase-and-markov-chains\/#article","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/fun-couchbase-and-markov-chains\/"},"author":{"name":"The Couchbase Team","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/764f4a6771ee19bc7af70b70a326fb93"},"headline":"Fun with Couchbase and Markov Chains","datePublished":"2012-11-15T08:00:00+00:00","dateModified":"2017-03-01T15:39:01+00:00","mainEntityOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/fun-couchbase-and-markov-chains\/"},"wordCount":138,"commentCount":0,"publisher":{"@id":"https:\/\/www.couchbase.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/fun-couchbase-and-markov-chains\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png","articleSection":["Uncategorized"],"inLanguage":"pt-BR","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.couchbase.com\/blog\/fun-couchbase-and-markov-chains\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.couchbase.com\/blog\/fun-couchbase-and-markov-chains\/","url":"https:\/\/www.couchbase.com\/blog\/fun-couchbase-and-markov-chains\/","name":"Fun with Couchbase and Markov Chains - The Couchbase Blog","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/fun-couchbase-and-markov-chains\/#primaryimage"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/fun-couchbase-and-markov-chains\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png","datePublished":"2012-11-15T08:00:00+00:00","dateModified":"2017-03-01T15:39:01+00:00","breadcrumb":{"@id":"https:\/\/www.couchbase.com\/blog\/fun-couchbase-and-markov-chains\/#breadcrumb"},"inLanguage":"pt-BR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.couchbase.com\/blog\/fun-couchbase-and-markov-chains\/"]}]},{"@type":"ImageObject","inLanguage":"pt-BR","@id":"https:\/\/www.couchbase.com\/blog\/fun-couchbase-and-markov-chains\/#primaryimage","url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png","contentUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png","width":1800,"height":630},{"@type":"BreadcrumbList","@id":"https:\/\/www.couchbase.com\/blog\/fun-couchbase-and-markov-chains\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.couchbase.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Fun with Couchbase and Markov Chains"}]},{"@type":"WebSite","@id":"https:\/\/www.couchbase.com\/blog\/#website","url":"https:\/\/www.couchbase.com\/blog\/","name":"Blog do Couchbase","description":"Couchbase, o banco de dados NoSQL","publisher":{"@id":"https:\/\/www.couchbase.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.couchbase.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"pt-BR"},{"@type":"Organization","@id":"https:\/\/www.couchbase.com\/blog\/#organization","name":"Blog do Couchbase","url":"https:\/\/www.couchbase.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"pt-BR","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/04\/admin-logo.png","contentUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/04\/admin-logo.png","width":218,"height":34,"caption":"The Couchbase Blog"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/764f4a6771ee19bc7af70b70a326fb93","name":"A equipe do Couchbase","image":{"@type":"ImageObject","inLanguage":"pt-BR","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/image\/7befc37d02226b59499817eafdec60c3","url":"https:\/\/secure.gravatar.com\/avatar\/b4c18c758421903398e84d6c9560f319f39c665798d7d23e6a6f9dff8a8f984e?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/b4c18c758421903398e84d6c9560f319f39c665798d7d23e6a6f9dff8a8f984e?s=96&d=mm&r=g","caption":"The Couchbase Team"},"description":"Jennifer Garcia \u00e9 gerente s\u00eanior de Web na Couchbase Inc. Como gerente do site, Jennifer tem a responsabilidade geral pelas propriedades do site, incluindo design, implementa\u00e7\u00e3o, conte\u00fado e desempenho.","sameAs":["https:\/\/www.couchbase.com"],"url":"https:\/\/www.couchbase.com\/blog\/pt\/author\/jennifer-garcia\/"}]}},"authors":[{"term_id":8968,"user_id":2,"is_guest":0,"slug":"jennifer-garcia","display_name":"The Couchbase Team","avatar_url":"https:\/\/secure.gravatar.com\/avatar\/b4c18c758421903398e84d6c9560f319f39c665798d7d23e6a6f9dff8a8f984e?s=96&d=mm&r=g","author_category":"","last_name":"Garcia","first_name":"Jennifer","job_title":"","user_url":"https:\/\/www.couchbase.com","description":"Jennifer Garcia \u00e9 gerente s\u00eanior de Web na Couchbase Inc. Como gerente do site, Jennifer tem a responsabilidade geral pelas propriedades do site, incluindo design, implementa\u00e7\u00e3o, conte\u00fado e desempenho."}],"_links":{"self":[{"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/posts\/1612","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/comments?post=1612"}],"version-history":[{"count":0,"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/posts\/1612\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/media\/13873"}],"wp:attachment":[{"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/media?parent=1612"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/categories?post=1612"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/tags?post=1612"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/ppma_author?post=1612"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}