Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
<!doctype html>
<html lang="en" class="h-100">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet" href="">
<link rel="stylesheet" href="" integrity="sha384-fnmOCqbTlWIlj8LyTjo7mOUStjsKC4pOpQbqyi7RrhN7udi9RwhKkMHpvLbHG9Sr" crossorigin="anonymous">
<title>Markov chain philosopher</title>
<meta name="description" content="Our philosopher uses Markov chain to build the most entertaining quotes for you."/>
<meta property="og:title" content="Markov chain philosopher" />
<meta property="og:type" content="website" />
<meta property="og:description" content="Our philosopher uses Markov chain to build the most entertaining quotes for you." />
.sentence {
min-height: 6em;
margin-bottom: 10px;
.social-share-none {
height: 0px;
visibility: hidden;
opacity: 0;
transition: all .35s ease-in-out;
.social-share {
margin-bottom: 10px;
visibility: visible;
opacity: 1;
transition: all .6s ease-in-out;
.btn-lg {
margin-bottom: 10px;
width: 260px;
<main role="main">
<section class="jumbotron text-center">
<div class="container">
<h1 class="jumbotron-heading">Markov the philosopher <i class="fab fa-earlybirds"></i></h1>
<div class="container">
<div class="sentence">
<mark id="sentence" class="text-monospace font-weight-bold text-info">|</mark>
<div id="social-share" class="social-share-none">
<button role="button" class="btn btn-warning btn-lg" onClick="tweet();">Worth tweeting? <i class="fab fa-twitter"></i></button>
<button class="btn btn-info btn-lg" role="button" onClick="enlightenMe()">Enlighten me</button>
<div class="container">
<a data-toggle="collapse" href="#data" aria-expanded="false" aria-controls="Teach">
Wanna teach something to the Philosopher?
<div class="collapse" id="data">
<div class="container-fluid">
<textarea class="form-control" rows="5" id="corpus"></textarea>
<div class="container">
<p class="lead text-muted">Get a daily dose of our gibberish philosopher. This is a simple Markov chain implementation to generate text. You can also train the philosopher with your own text, whatever you like.</p>
<script src=""></script>
<script src=""></script>
<script src=""></script>
<!-- Markov chain -->
var corpus = "Life is just a chance to grow a soul. Only a life lived for others is a life worthwhile. Expect nothing, live frugally on surprise. Because I have loved life, I shall have no sorrow to die. People living deeply have no fear of death. Everything has beauty, but not everyone sees it. If you obey all the rules, you miss all the fun. Mistakes are part of the dues that one pays for a full life. The mind is a wonderful servant but a terrible master. Success is the best revenge for anything. Nothing will work unless you do. Don't stumble over something behind you. If you judge people you have no time to love them. Don't raise your voice. Improve your argument. Don't hate what you don't understand. No one has ever become poor by giving. The most decisive actions of our life... are most often unconsidered actions. Life is a process. We are a process. The universe is a process. The good life is inspired by love and guided by knowledge. Our lives are like a candle in the wind. Be a voice not an echo. It is not only necessary to love, it is necessary to say so. Love is great when you find someone to give it to. Love is neither true or false, love is love. Man loves little and often: Woman much and rarely. Reason and love are sworn enemies. There is only one happiness in life - to love and to be loved. Where there is love there is life. Love is an act of endless forgiveness, a tender look which becomes a habit. Follow love and it will flee, flee love and it will follow. Love is trembling happiness. The courses of true love never did run smooth. All is well in the world when in love. The only way to have a friend is to be one. My best friend is the one who brings out the best in me. Friendship is like money, easier made than kept. Friendship is a sheltering tree. A friend is one who knows us, but loves us anyway. Fate chooses our relatives, we choose our friends. Choose your friends carefully. Your enemies will choose you. Only your real friends tell you when your face is dirty. A faithful friend is the medicine of life. The antidote for fifty enemies is one friend. The most I can do for my friend is simply be his friend. It is easier to forgive an enemy than to forgive a friend. There are only two great tragedies in life: one is not getting what you want and the other is getting it. Books say: She did this because. Life says: She did this. Books are where things are explained to you; life is where things aren’t. I’m not surprised some people prefer books. Thousands of candles can be lighted from a single candle, and the life of the candle will not be shortened. Happiness never decreases by being shared. Learn from yesterday, live for today, hope for tomorrow. The important thing is not to stop questioning. Love takes off the masks that we fear we cannot live without and know we cannot live within. Sometimes the questions are complicated, and the answers are simple. What gets us into trouble is not what we don’t know. It’s what we know for sure that just ain’t so. Anyone who has never made a mistake has never tried anything new. Knowing what must be done does away with fear. Holding onto your anger is like drinking poison and expecting the other person to die. Life can only be understood backwards; but it must be lived forwards. It’s not that I’m so smart. It’s just that I stay with problems longer. Life is really simple, but we insist on making it complicated. The two most important days of your life are the day that you’re born and the day that you find out why. Education is not the learning of the facts, but the training of the mind to think. In three words I can sum up everything I’ve learned about life: it goes on. The present moment is filled with joy and happiness. If you are attentive, you will see it. A bird doesn't sing because it has an answer, it sings because it has a song. We learn from experience that men never learn anything from experience. Every man is a damn fool for at least five minutes every day; wisdom consists in not exceeding the limit. If you surrender to the wind, you can ride it. We don’t see things the way they are. We see them the way we are. A journey of a thousand miles begins with a single step. All life is an experiment. The more experiments you make, the better. Be more concerned with your character than your reputation, because your character is what you really are, while your reputation is merely what others think you are. I write because I don’t know what I think until I read what I say. Learn from the mistakes of others. You can’t live long enough to make them all yourself. Many receive advice, only the wise profit from it. Destiny is a name often given in retrospect to choices that had dramatic consequences. The test of a first-rate intelligence is the ability to hold two opposed ideas in mind at the same time and still retain the ability to function. We don’t laugh because we’re happy – we’re happy because we laugh. Now and then it’s good to pause in our pursuit of happiness and just be happy. Don’t take life too seriously. You’ll never get out of it alive. Don’t cry because it’s over, smile because it happened. Doing what you like is freedom. Liking what you do is happiness. There is more to life than increasing its speed. When one door of happiness closes, another opens, but often we look so long at the closed door that we do not see the one that has been opened for us. Life is 10 percent what happens to you and 90 percent how you respond to it. True happiness arises, in the first place, from the enjoyment of one’s self. Time you enjoy wasting is not wasted time. Three grand essentials to happiness in this life are something to do, something to love, and something to hope for. Happiness, not in another place but this place…not for another hour, but this hour. Folks are usually about as happy as they make their minds up to be. Happiness? That’s nothing more than health and a poor memory. It’s the moments that I stopped just to be, rather than do, that have given me true happiness. I am very happy because I have conquered myself and not the world. I am very happy because I have loved the world and not myself. What a wonderful life I’ve had! I only wish I’d realized it sooner. My mission in life is not merely to survive, but to thrive; and to do so with some passion, some compassion, some humor, and some style. Our greatest happiness does not depend on the condition of life in which chance has placed us, but is always the result of a good conscience, good health, occupation, and freedom in all just pursuits. People don’t notice whether it’s winter or summer when they’re happy. Success is getting what you want. Happiness is wanting what you get. Boredom is the feeling that everything is a waste of time…serenity, that nothing is. One happiness scatters a thousand sorrows. One of the keys to happiness is a bad memory. Be a Fruitloop in a world of Cheerios. Cry. Forgive. Learn. Move on. Let your tears water the seeds of your future happiness. He who lives in harmony with himself lives in harmony with the universe. If you want to be happy, be. If you aren’t grateful for what you already have, what makes you think you would be happy with more. You can only have bliss if you don’t chase it. For every minute you are angry you lose sixty seconds of happiness. Life is really simple, but we insist on making it complicated. he best way to cheer yourself is to try to cheer someone else up. If you want others to be happy, practice compassion. If you want to be happy, practice compassion. Happiness is when what you think, what you say, and what you do are in harmony. Happiness is not something ready made. It comes from your own actions. In our lives, change is unavoidable, loss is unavoidable. In the adaptability and ease with which we experience change, lies our happiness and freedom. Thousands of candles can be lit from a single candle, and the life of the candle will not be shortened. Happiness never decreases by being shared. The biggest adventure you can take is to live the life of your dreams. Happiness in intelligent people is the rarest thing I know. The most important thing is to enjoy your life – to be happy – it’s all that matters. The advantage of a bad memory is that one enjoys several times the same good things for the first time. Learn to value yourself, which means: fight for your happiness. Indeed, man wishes to be happy even when he so lives as to make happiness impossible. Happiness depends upon ourselves. Only a life lived for others is a life worthwhile. Happiness is a state where nothing is missing. The constant happiness is curiosity. Be happy. It’s one way of being wise. Doing what you were born to do … That’s the way to be happy. Being happy is not the only happiness. Enjoy it. Because it’s happening. No medicine cures what happiness cannot. It is more fitting for a man to laugh at life than to lament over it. Happiness is acceptance. It is not how much we have, but how much we enjoy, that makes happiness. The foolish man seeks happiness in the distance, the wise grows it under his feet. There is only one happiness in this life, to love and be loved. Nobody can be uncheered with a balloon. Be happy for this moment. This moment is your life. Joy is prayer; joy is strength: joy is love; joy is a net of love by which you can catch souls. I must learn to be content with being happier than I deserve. Whoever is happy will make others happy. Happiness lies in the joy of achievement and the thrill of creative effort. We forge the chains we wear in life. I’m happy. Which often looks like crazy. Happiness does not lead to gratitude. Gratitude leads to happiness. Happiness is a gift and the trick is not to expect it, but to delight in it when it comes. It is the very mark of the spirit of rebellion to crave for happiness in this life. So we shall let the reader answer this question for himself: who is the happier man, he who has braved the storm of life and lived or he who has stayed securely on shore and merely existed? The only way to find true happiness is to risk being completely cut open. People are unhappy when they get something too easily. You have to sweat – that’s the only moral they know. The greatest secret to happiness and peace is letting every life situation be what it is, instead of what you think it should be. Then, make the very best of it. If you want to be happy, set a goal that commands your thoughts, liberates your energy, and inspires your hopes. I am not bound to win, I am bound to be true. I am not bound to succeed, but I am bound to live up to the light I have. Remember your dreams and fight for them. You must know what you want from life. There is just one thing that makes your dream become impossible: the fear of failure. Today is life – the only life you are sure of. Make the most of today. Get interested in something. Shake yourself awake. Develop a hobby. Let the winds of enthusiasm sweep through you. What we think determines what happens to us, so if we want to change our lives, we need to stretch our minds. There is no passion to be found playing small – in settling for a life that is less than the one you are capable of living. If you don’t design your own life plan, chances are you’ll fall into someone else’s plan. And guess what they have planned for you? Not much. Live with intention. Walk to the edge. Listen hard. Practice wellness. Play with abandon. Laugh. Choose with no regret. Do what you love. Live as if this is all there is. Today is life–the only life you are sure of. Make the most of today. Get interested in something. Shake yourself awake. Develop a hobby. Let the winds of enthusiasm sweep through you. The greatest happiness you can have is knowing that you do not necessarily require happiness. In the end, it’s not the years in your life that count. It’s the life in your years. Pleasure is very seldom found where it is sought. Our brightest blazes are commonly kindled by unexpected sparks. On the whole, the happiest people seem to be those who have no particular cause for being happy except that they are so. Plenty of people miss their share of happiness, not because they never found it, but because they didn’t stop to enjoy it. I have only two kinds of days: happy and hysterically happy. Some cause happiness wherever they go; others whenever they go. Life is short. Smile while you still have teeth. There is no cosmetic for beauty like happiness. To be stupid, selfish, and have good health are three requirements for happiness, though if stupidity is lacking, all is lost. Sanity and happiness are an impossible combination. Expecting life to treat you well because you are a good person is like expecting an angry bull not to charge because you are a vegetarian. Of all the things you wear, your expression is the most important. The hardest thing to find in life is happiness – money is only hard to find because it gets wasted trying to find happiness. You can’t buy happiness but you can buy ice cream. And that’s kind of the same thing. When someone told me I lived in a fantasy land I nearly fell of my unicorn. Some days I amaze myself. Other days I put my keys in the fridge. Happiness does not have a price tag so smile. Be happy. It really annoys negative people. One day, or day one, you decide. Happiness is not out there, it’s in you. Difficult roads often leads to beautiful destinations. The key to being happy is knowing you have the power to choose what to accept and what to let go. Don’t let the silly little things steal your happiness. There is no cosmetic for beauty life happiness. There is no happiness; there are only moments of happiness. People wait all week for Friday, all year for summer, all life for happiness. Cheerfulness is the very flower of health. The secret of being happy is accepting where you are in life and making the most out of everyday. There are so many beautiful reasons to be happy. Life only comes around once, so do whatever makes you happy, and be with whoever makes you smile. Happiness is not a goal: it is a by-product. Someday you’ll look back and understand why it all happened the way it did. Doing what you like is freedom. Liking what you do is happiness. One of the simplest ways to stay happy is letting go of the things that makes you sad. We can’t direct the wind, but we can adjust the sails. There a so many beautiful reasons to be happy. My life is my message. Not how long, but how well you have lived is the main thing. I love those who can smile in trouble. Be happy for this moment. This moment is your life. Life is what happens when you’re busy making other plans. Very little is needed to make a happy life; it is all within yourself, in your way of thinking. It is better to be hated for what you are than to be loved for what you are not. Life is like playing a violin in public and learning the instrument as one goes on. Leave no stone unturned. Fight till the last gasp. Stay hungry. Stay foolish. Broken crayons still color. And so the adventure begins. If you want it, work for it. You can if you think you can. Whatever you are, be a good one. Impossible is for the unwilling. Grow through what you go through. The wisest mind has something yet to learn. Take the risk or lose the chance. Do it with passion or not at all. She believed she could, so she did. The past does not equal the future. Good things happen to those who hustle. At the end of hardship comes happiness. Don’t dream your life, live your dream. If it matters to you, you’ll find a way. Forget about style; worry about results. Whatever you do, do with all your might. Dream without fear. Love without limits. Every noble work is at first impossible. If you’re going through hell, keep going. You can do anything you set your mind to. We are twice armed if we fight with faith. Open your mind. Get up off the couch. Move. Be faithful to that which exists within yourself. Persistence guarantees that results are inevitable. In life you need either inspiration or desperation. I would rather die on my feet than live on my knees. The true success is the person who invented himself. Don’t tell people your plans. Show them your results. Let him that would move the world first move himself. Go forth on your path, as it exists only through your walking. We can do anything we want to if we stick to it long enough. It does not matter how slowly you go as long as you do not stop. It is better to live one day as a lion, than a thousand days as a lamb. Life is fragile. We’re not guaranteed a tomorrow so give it everything you’ve got. The two most important days in your life are the day you are born and they day you find out why. Fall seven times, stand up eight. You make mistakes. Mistakes don’t make you. Breathe. It’s just a bad day, not a bad life. The first step is you have to say that you can. Start every day off with a smile and get it over with. If you want to lift yourself up, lift up someone else. It’s okay to not be okay as long as you are not giving up. If you feel like giving up, look back at how far you’ve come. Every day may not be good but there is something good in every day. Don’t go through life, grow through life. A problem is a chance for you to do your best. You are amazing. As you are. Stronger than you know. Everything is going to be okay in the end. If it’s not the okay, it’s not the end. When nothing goes right, go left. Life is too short to learn German. Why do they put pizza in a square box? Do crabs think we walk sideways? Don’t be humble, you’re not that great. I intend to live forever. So far, so good. My life feels like a test I didn’t study for. Why is there an expiration date on sour cream? This suspense is terrible. I hope it will last. I drive way too fast to worry about cholesterol. A day without sunshine is like, you know, night. In heaven, all the interesting people are missing. The last woman I was in was the Statue of Liberty. Women want love to be a novel. Men, a short story. Guests, like fish, begin to smell after three days. Go to Heaven for the climate, Hell for the company. Change is inevitable – except from a vending machine. I bet giraffes don’t even know what farts smell like. Every novel is a mystery novel if you never finish it. Why is the slowest traffic of the day called ‘rush hour’? It’s easy to quit smoking. I’ve done it hundreds of times. The risk I took was calculated, but man, I am bad at math. I couldn’t repair your brakes, so I made your horn louder. Just when I discovered the meaning of life, they changed it. Always borrow money from a pessimist. He won’t expect it back. If truth is beauty, how come no one has their hair done in a library? I love deadlines. I love the whooshing noise they make as they go by. I never feel more alone than when I’m trying to put sunscreen on my back. Those are my principles, and if you don’t like them… well, I have others. The key to eating healthy is not eating any food that has a TV commercial. I’ve got to keep breathing. It’ll be my worst business mistake if I don’t. There are three types of people in this world: those who can count, and those who can’t. The closest a person ever comes to perfection is when he fills out a job application form. Throw kindness around like confetti. If you are not too long, I will wait here for you all my life. When it rains look for rainbows. When it’s dark look for stars. To the world you may be one person, but to one person you are the world. No pressure, no diamonds. Every wall is a door. The only truth is music. Silence is an answer too. If youth knew; if age could. Time is the soul of this world. Stars can’t shine without darkness. It takes a long time to become young. Be who you needed when you were young. Innocence is courage and clarity both. Find what you love and let it kill you. Sadness flies away on the wings of time. I am not young enough to know everything. Life is like the ocean, it goes up and down. The eyes are useless when the mind is blind. If you’re not confused, you’re not paying attention. You’ve gotta know what death is to know life. Don’t let yesterday take up too much of today. Forgiveness is giving up hope for a better past. Be kind to unkind people, they need it the most. Solitary trees, if they grow at all, grow strong. Art is the lie that enables us to realize the truth. Enlightenment is when a wave realizes it is the ocean. This is your life, and it’s ending one minute at a time. Hearts are wild creatures, that’s why our ribs are cages. Life without love is like a tree without blossoms or fruit. Your faith can move mountains and your doubt can create them. The knowledge of happiness brings the knowledge of unhappiness. There are those who give with joy, and that joy is their reward. You are not a drop in the ocean. You are the entire ocean in a drop. Normality is a paved road: it’s comfortable to walk, but no flowers grow on it. One is never afraid of the unknown; one is afraid of the known coming to an end. When you’re happy you enjoy the music, when you’re sad you understand the lyrics. When you’ve seen beyond yourself, then you may find, peace of mind is waiting there. You have to be odd to be number one. Please all, and you will please none. The fool wonders, the wise man asks. A smooth sea never made a skillful sailor. Pain is inevitable. Suffering is optional. A man can’t ride your back unless it’s bent. Don’t raise your voice. Improve your argument. Chop your own wood and it will warm you twice. Some people are so poor, all they have is money. All generalizations are false, including this one. It’s not what you look at that matters, it’s what you see. There is no saint without a past, no sinner without a future. We make a living by what we get, but we make a life by what we give. It’s so strange that autumn is so beautiful; yet everything is dying. It’s no wonder that truth is stranger than fiction. Fiction has to make sense. The man who wants to lead the orchestra must turn his back on the crowd. What counts can’t always be counted; what can be counted doesn’t always count. As a well-spent day brings happy sleep, so a life well spent brings happy death. Life is not about how fast you run or how high you climb, but how well you bounce. Concentration is the ability to think about absolutely nothing when it is absolutely necessary. It is better to remain silent and be thought a fool than to open one’s mouth and remove all doubt. Meditation is the art of doing nothing. Even in the midst of disturbance, the stillness of the mind can offer sanctuary. Learn to slow down. Get lost intentionally. Observe how you judge both yourself and those around you. Suffering is due to our disconnection with the inner soul. Meditation is establishing that connection. To really do nothing, with perfection, is as difficult as doing everything. You have a treasure within you that is infinitely greater than anything the world can offer. Wisdom comes with the ability to be still. Just look and listen. No more is needed. Be here now. Be someplace else later. Is that so complicated? Live the actual moment. Only this actual moment is life. Don’t seek, don’t search, don’t ask, don’t knock, don’t demand – relax. Life is a mystery – mystery of beauty, bliss and divinity. Meditation is the art of unfolding that mystery. Paradise is not a place, it’s a state of consciousness. Whatever state I am in, I see it as a state of mind to be accepted as it is. When we are unable to find tranquility within ourselves, it is useless to seek it elsewhere. You are more than just your mind. You are more than just your habits. You are more than just your preferences. You’re a level of awareness. To be concentrated means to live fully in the present. The mind is definitely something that can be transformed, and meditation is a means to transform it. The more tranquil a man becomes, the greater is his success, his influence, his power for good. Quiet the mind, and the soul will speak. Do not dwell in the past, do not dream of the future, concentrate the mind on the present moment. Calmness of mind is one of the beautiful jewels of wisdom. Learn to be calm and you will always be happy. Whatever is fluid, soft, and yielding will overcome whatever is rigid and hard. What is soft is strong. When meditation is mastered, the mind is unwavering like the flame of a candle in a windless place. When you own your breath, nobody can steal your peace. Nowhere can man find a quieter or more untroubled retreat than in his own soul. Your calm mind is the ultimate weapon against your challenges. So relax. When you realize there is nothing lacking, the whole world belongs to you. The meaning of life is to find your gift. The purpose of life is to give it away. Life, it seems, is nothing if not a series of initiations, transitions, and incorporations. Life becomes harder for us when we live for others, but it also becomes richer and happier. Life is not measured by the number of breaths we take, but by the moments that take our breath away. Life is pure adventure, and the sooner we realize that, the quicker we will be able to treat life as art. I’ve never been poor, only broke. Being poor is a frame of mind. Being broke is only a temporary situation. Enjoy the little things in life because one day you’ll look back and realize they were the big things. I think people spend too much time staring into screens and not enough time drinking wine, tongue kissing, and dancing under the moon. To love is to act. Do all things with love. Speak low, if you speak love. Economized love is never real love. Love does not dominate; it cultivates. Life is a game and true love is a trophy. They do not love that do not show their love. Intense love does not measure, it just gives. If love appears, boundaries will disappear. It is love alone that gives worth to all things. Life in abundance comes only through great love. Never love anyone who treats you like you’re ordinary. Perhaps one did not want to be loved so much as to be understood. Never let an opportunity to tell someone how much they mean to you. The quickest way to get someone’s attention is to no longer want it. True love is like ghosts, which everyone talks about and few have seen. You are not designed for everyone to like you. Wanting to be someone else is a waste of who you are. Whatever makes you weird is probably your greatest asset.If you are lonely when you’re alone, you are in bad company. The worst loneliness is not to be comfortable with yourself. Be yourself. People don’t have to like you, and you don’t have to care. Your value doesn’t decrease based on someone’s inability to see your worth. It is better to be hated for what you are than to be loved for what you are not. I found that there is only one thing that heals every problem, and that is: to know how to love yourself. Simplify, simplify. Own less. Do more. More life, less rush. Buy less, choose well. Do more of what matters. Fewer things. More peace. Brevity is the soul of wit. Stop the glorification of busy. Simplicity is the soul of efficiency. Once you need less, you will have more. I make myself rich by making my wants few. Owning less is better than organizing more. He is richest who is content with the least. Learn to say no without explaining yourself. Someone else is happy with less than you have. Minimalism is not deprivation, it’s liberation. The most important things in life aren’t things. The verbal expression of simplicity is ‘no thanks’. Remember, you probably already have more than you need. Life is really simple, but we insist on making it complicated. The more possessions you have, the less time you have to enjoy them. My goal is no longer to get more done, but rather to have less to do. A smile is the beginning of peace. Nonviolence is a weapon of the strong. Peace is the only battle worth waging. Freedom from desire leads to inner peace. It is possible to choose peace over worry. There is no way to peace, peace is the way. Peace is costly but it is worth the expense. Don’t hurry. Don’t worry. Do your best and let it rest. To the mind that is still, the whole universe surrenders. I know but one freedom and that is the freedom of the mind. Let loose of what you can’t control. Serenity will be yours. He is happiest, be he king or peasant, who finds peace in his home. Seek truth and you will find a path. Adversity is the first path to truth. The object of the superior man is truth. Man is the only creature that refuses to be what he is. We have art in order not to die of the truth. We search something permanent, something that will last. If you tell the truth, you don’t have to remember anything. Silence is true wisdom’s best reply. Do what is right, not what is easy. I’m wise because I’ve been foolish. A loving heart is the truest wisdom. To find yourself, think for yourself. Persevere and get it done. Never, never, never give up. Much effort, much prosperity. Slow and steady wins the race. How long should you try? Until. If you don’t ask, you don’t get. Nothing worth having comes easy. I will not walk backward in life. It’s pain that changes our lives. Our whole life is solving puzzles. The struggle is part of the story. Persevere in virtue and diligence. Life is short and progress is slow. No great thing is created suddenly. Patience is the companion of wisdom. Perseverance, secret of all triumphs. Victory belongs to the most persevering. I’m a slow walker, but I never walk back. In the middle of difficulty lies opportunity. Never give up on the things that make you smile. He that can have patience can have what he will. A lost battle is a battle one thinks one has lost. The journey of a thousand miles begins with one step. You get credit for what you finished, not what you started. Thankfully, persistence is a great substitute for talent. A man will fight harder for his interests than for his rights. Anyone who has ever made anything of importance was disciplined. Nothing is permanent in this wicked world, not even our troubles. No matter how you feel, get up, dress up, show up and never give up. Don’t quit. Suffer now and live the rest of your life as a champion. Difficult things take a long time, impossible things a little longer. A river cuts through a rock not because of its power but its persistence. Believing requires action. You can totally do this. Humor comes from self-confidence. We are always the same age inside. Trust is the greatest intelligence. The most beautiful thing you can wear is confidence. All you need is ignorance and confidence and the success is sure. I’m always impressed by confidence, kindness and a sense of humor. Confidence in the goodness of another is good proof of one’s own goodness. Too many people overvalue what they are not and undervalue what they are. I do not believe in taking the right decision, I take a decision and make it right. An artist is an explorer. Go wild, for a while. Imagination rules the world. Be anything but predictable. Creativity is not a competition. Zeal will do more than knowledge. Pure logic is the ruin of the spirit. Without freedom, there is no creation. Creativity comes from a conflict of ideas. The man who has no imagination has no wings. Be yourself; everyone else is already taken. You were born an original, don’t die a copy. I like nonsense, it wakes up the brain cells. Name the greatest of all inventors - Accident. Originality is nothing but judicious imitation. Creativity is the greatest rebellion in existence. Consistency is the last refuge of the unimaginative. I begin with an idea, and then it becomes something else. Creativity requires the courage to let go of certainties. In order to be irreplaceable one must always be different. Mystery is at the heart of creativity. That, and surprise. No great mind has ever existed without a touch of madness. A work of art is the unique result of a unique temperament. The inner fire is the most important thing mankind possesses. There is no innovation and creativity without failure. Period. To live a creative life, we must lose our fear of being wrong. A man may die, nations may rise and fall, but an idea lives on. The true sign of intelligence is not knowledge but imagination. If you want something new, you have to stop doing something old. Learn the rules like a pro, so you can break them like an artist. It is better to fail in originality than to succeed in imitation. Until they become conscious they will never rebel, and until after they have rebelled they cannot become conscious. I rebel; therefore I exist. He drew a circle that shut me out-Heretic, rebel, a thing to flout. But love and I had the wit to win: We drew a circle and took him In! The most subversive people are those who ask questions. Freedom is always, and exclusively, freedom for the one who thinks differently. When most of the greatest individuals in history were misunderstood and you've spent so much of your own adult life misunderstood, you can't help but believe that the majority of people know very little worth knowing. I am not an angel, and I will not be one till I die: I will be myself. Adventure is worthwhile in itself. Nobody can tell me what I can and cannot do. I was built this way for a reason, so I'm going to use it. Light travels faster than sound. This is why some people appear bright until they speak. Honesty is the key to a relationship. If you can fake that, you’re in. A celebrity is a person who works hard all his life to become well known, then wears dark glasses to avoid being recognized. An archaeologist is the best husband any woman can have; the older she gets, the more interested he is in her. First the doctor told me the good news: I was going to have a disease named after me. Friendship is like peeing on yourself: everyone can see it, but only you get the warm feeling that it brings. Everything is funny, as long as it's happening to somebody else. Knowledge is like underwear. It is useful to have it, but not necessary to show it off. If a book about failures doesn’t sell, is it a success? It’s okay if you don’t like me. Not everyone has good taste. The difference between stupidity and genius is that genius has its limits. Tomorrow is often the busiest day of the week. I remixed a remix, it was back to normal. A lot of people are afraid of heights. Not me, I’m afraid of widths. Never miss a good chance to shut up. Don’t judge me. I was born to be awesome, not perfect. My brain has too many tabs open. My fake plants died because I did not pretend to water them.";
class Markov {
constructor(text) {
this.dict = this.parseText(text);
this.keys = Object.keys(this.dict);
this.keys.length < 30
? this.maxLength = this.keys.length + 10
: this.maxLength = 30;
this.punct = /\.|\?|\!/;
parseText(text) {
let dict = {};
.map(function(item) {
return item.trim();
.forEach(function(item, index, arr) {
if (index < arr.length - 2) {
let key = [item, arr[index + 1]].join(' ');
dict[key] = dict[key] || [];
dict[key].push(arr[index + 2]);
return dict;
getRandomKey() {
return this.keys[Math.floor(Math.random() * this.keys.length)];
getRandomValue(key) {
let search;
? search = key
: search = this.getRandomKey();
return this.dict[search][Math.floor(Math.random() * this.dict[search].length)];
getCapitalizedKey() {
let tries = this.maxLength;
let key;
while (tries--) {
key = this.getRandomKey();
if (/[A-Z]/.test(key.charAt(0)) && !this.punct.test(key))
return key.replace(this.punct, '');
generateSentence() {
let maxLength = this.maxLength;
let sentence = [].concat(this.getCapitalizedKey().split(' '));
while (maxLength--) {
let search = sentence.slice(-2).join(' ');
let found = this.getRandomValue(search);
if (this.punct.test(sentence.slice(-1))) break;
if(maxLength === 0) sentence[sentence.length-1] += '.';
return sentence.join(' ');
generate(sentenceCount) {
let sentences = [];
while (sentenceCount--) {
return sentences.join(' ');
<!-- This page -->
document.getElementById('corpus').value = corpus;
var written = 0;
var message = '';
function enlightenMe() {
var generator = new Markov(document.getElementById('corpus').value);
var output = document.getElementById('sentence');
message = generator.generate(1);
type(message, output);
function clearType(output) {
var id = window.setTimeout(function() {}, 0);
while (id--) {
window.clearTimeout(id); // will do nothing if no timeout with id is present
output.innerHTML = '';
written = 0;
message = '';
function type(message, output) {
var i = 0;
output.innerHTML += letter;
written += 1;
if (written >= message.length) {
}, i++ * 200);
function showSocialShare() {
var share = document.getElementById('social-share');
function hideSocialShare() {
var share = document.getElementById('social-share');
function tweet() {
var msg = message;
if (msg.length < 245) {
msg += ' - Markov the gibberish philosopher';
var twitterWindow =',markovchain&url=' + msg, 'twitter-popup', 'height=350,width=600');
if(twitterWindow.focus) {
return false;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment