Using Markov Chain Generator to create Donald Trump’s state of union speech

There is no requirement in the U.S. Constitution that the President must speak in the U.S. House of Representatives to deliver his State of the Union Address. In fact, prior to the age of television, presidents delivered it in writing.

Speaker Pelosi told Donald Trump that while we are in the midst of a government shutdown, perhaps the SOTU address should be delayed.

The truth is that Trump doesn’t need to speak in the U.S. Capitol to deliver whatever speech he wants. The man tweets and talks daily. There is very little he can say that will be new, unifying, or insightful.

Since Trump’s Twitter account is such a great source of his stream of consciousness, his sentences so grammatically incorrect, and his speeches are so incoherent that it is very simple to write a program that will talk, write, and speak exactly like Donald Trump.

Humor seems to be all we have left in this era of political discord and division. So, let’s have some fun with Markov Chains.

Get an archive of Trump’s tweets

I got a JSON document of Trump’s tweets from Trump tweet archive. I limited it to his time as POTUS. Perhaps it would be more interesting to use his entire time on twitter as a source, but I will leave that as an exercise for the reader.

Write a Markov Chain generator

The next thing I did was I wrote a simple program in JavaScript that uses the markovchain module. It took me about 10 mins to put this together:

const fs=require('fs');
const MarkovChain=require('markovchain');

const m=new MarkovChain();

const trumpPotusStr = fs.readFileSync('./trump-potus.json').toString('utf-8');
const trumpPotus = JSON.parse(trumpPotusStr);


const selectWord = function(wordList) {
  var tmpList = Object.keys(wordList).filter(function(word) {
    return word[0] >= 'A' && word[0] <= 'Z'
  })
  return tmpList[~~(Math.random()*tmpList.length)]
}

for (var i = 0;i<trumpPotus.length;i  ) {
    m.parse(trumpPotus[i]['text'])//.toLowerCase());
}

for (var i=0;i<355;i  ) {
    const l = 5 Math.random()*15;
    const sentence = m.start(selectWord).end(l).process().replace(/(?:https?|ftp):\/\/[\n\S] /g, '').replace('#','').replace('@','');    
    console.log(sentence '.\n');
}

Note that the loop at the end generates 355 sentences of 5 to 20 words each, cleaning up the URLs, hashtags, and mentions. That roughly adds up to ~5000 words which take Trump about an hour to deliver.

Trump’s SOTU speech as generated by the Markov Chain program

I ran the program and it resulted in the following. I edited nothing. Does it sound like a credible Trump rally speech? Would this program be a better president? You be the judge:

Chris Farrell, Judicial Watch: .

Utah’s MAGNIFICENT Winter White House votes to helping us w/ President of credit, but they represent our military would believe.

Keystone XL and its last night’s election in Bill) and epic victory: 53.

Ashraf Ghani of Rx pills disposed! Let’s not even better if necessary to take and we have been.

Madame Peng Liyuan in favor of Mexico and Turkey is now in Pittsburgh I LOVE YOU are.

Reagan! .

High” .

Mexican soldiers injured but to North Korea etc.

Donald, had his whole investigation that because it on having the Philippines tomorrow morning.

Troopers are very expensive solution for Congress! .

Kavanough has been very busy two years than 40% since leaving.

Regarding Recent Executive Order on illegal immigrants from the American.

Cmte Chair the United States” .

NFLplayer PatTillman joined again OPEN FOR BUSINESS! .

Change is on FoxNews “Outgoing CIA Director, Gina Haspel will help!.

Anton on health & others, after a 7 years ago, people that sections of Judge Jeanine Pirro is.

Surplus with Don McGahn, and are working hard for your support! .

Vets, etc.

Lou! .

Malaysia and Senate alone (poor me) for Governor Rick Scott called for a bilateral meeting with Chuck can all odds,.

Judge Neil Gorsuch prior to the storm the Democrats just a dark and.

Nations vote out of Americans has done by Dems that is fatally flawed because of the U system to.

Lockheed & fairly by the reforms we recite the WhiteHouse today! MAGA .

AWAY from the Fake News Media worked tirelessly on Crime fighter who has done in history of.

Sanford has been “playing” the brave man! .

Market, lowest number of freedom, pipelines, border yesterday in Florida are up $5 BILLION of Judge Brett Kavanaugh.

INCLUDING THE PEOPLE! .

DHS, CBP, and @CortesSteve on this problem is, a lobbyist for obstructing good news coming back in 10 minutes with.

Ohio Republican Party’s California for ALL! .

Commencment Address the order to host a.

LEOs have cooperated with distinction to be.

Repeal & smart, but to 49%, a fantastic.

Eric, we must quickly fix now!.

Bergdahl is able to bring peace for the meeting in proper form!.

Kuwait! Joint Press Conference Room with the United States Holocaust Remembrance Day in:.

Money pouring into terrorism and our cherished and match you! .

Tweets (along with their failed “experts” weighing in, and for her government in World WAS BARACK.

Alien Deported 11 months, only Rand Paul Manafort was forced to the fact that meeting today talking.

Drugs now! No wonder their already suffering in Granite City, Illinois, only 5 million people all, had a major.

GREATNESS as a decorated Vietnam & disfunction in the.

Act’ .

Faulkner, “9 Rules of hours! MAGA .

Phones, and wealth goodbye! Yesterday in the.

STEEL BACK – the Senate, they were not even if you to recuse himself was kept Arizona and have left.

It will be your Congressman, Troy_Balderson of Donald Trump would also about working hard pressed to Service lost.

Brussels, Bel….

Interior RyanZinke will not Presidential!”.

Corning, Merck & Water – it probably don’t like or Steel for no place and bond remain in House.

Nation’s crumbling infrastructure will then sold in our great people, from our soon be “wire tapping”.

Guns & around the United States and highly conflicted) was my account is.

Campaign” Judge Brett Kavanaugh in Pennsylvania, and extremism are heading to engage G7.

Comey, McCabe, Strzok – and more than good job, received a 122% increase in 50 percent the most dishonest,.

Tuesdays Primary in real enemy of the U system of.

Earlier this is very good old fashioned way, wasn’t enough.

Laws now he’s delivering results for Congress must now focus on getting ready to keep making AmericaFOUR TRILLION dollars.

Apprentice, he thought Crooked Hillary was the Trump Tower meeting with people, THANK YOU JIATFSouth, Norad_Northcom,.

JANUARY ELEVENTH in this morning to D.

Bought and .

Souther Border Patrol, ICE Director: “There is a hard on.

Instead of his phony an empty figure out these horrible and well! foxandfriends now!.

Taxes: “This cannot be a double standard of.

Bend, and false accusations and USNationalGuard .

Regime does not exist but it just put Democrats do.

EXACT OPPOSITE in Korea!.

Lake Okeechobee and most sweeping the large number that has worn the laws should be submitted.

Stay tuned! UNGA .

Street Journal has not good! MAGA .

XINPING and military and VOTE to Nuclear Button, but it has much.

NCAA Football Champion Chicago this great job, could.

Proclamation➡️… .

MAGA! Strong Military, which are w/you more meetings with Russia to Open Borders and.

Columbia Law Enforcement and, if she explained it came together to the 2nd Amendment from H for.

PEAC… .

STRONGER relationship while the newest and Medicare! Cast you Jerry,.

Bomb Scares .

D’s oppose sanctuary cities’ .

Special Councel with the disgrace to stop the “crime” of.

LIED! LIED! LIED! McCabe wife of people are riots in the last night from WestervillePD.

Dossier, he doesn’t exist or 2, 3, 2017, the European Union, if.

Drop to Doug Schoen for their safety of their FAKE MEDIA goes around, comes with.

Danny – Call for American People in the HORRIBLE statements on the table, but then be very strong.

Pennsylvania tonight presenting a final shots) we play a race was with his thoughts and violent crimes of the.

Standard, run in order to provoke Turkey for final numbers TANKED when many of our Nation, THANK.

Deal & washingtonpost gas prices to the beginning! .

Country’s biggest and women on FoxNews beat us all conspiracy theories and automobile.

Georgia early vote on non-military lines in Pennsylvania tonight against the planned Summit with the.

Sisi will be there only up 5 times – and we show very special and the snow filled.

Cable Association this morning at everything within.

Goodwin of our Military, Crime, Military, our Agenda of billions of Judicial Watch.

Turley on a lobbyist newspaper, the Team on Crime, ICE and corrupt people and Trump to say the Texas stand.

EVERYONE, INCLUDING MANY points of people of a security of State & getting absolutely nuts.

Sewer – I did I am monitoring the one.

Gerald R tie the U system that this to his.

Fantastic job! A very busy two FBI take back to denounce and slanted,.

South, NORTHCOM and peace through our Coast Guard that POTUS @realDonaldTrump for Congressman Neal has had to.

NYTIMES & genius at all of the Hillary & to.

Ralph Northam regarding urban America that took place in Brussels, Belgium this really helping!.

Pro-Trump! Virtually every new found friend EdWGillespie will only has.

Reid was paid for John has ever before.

Be careful and visit from China once again! .

Republicans, and not smart fast the Governor.

Treasury Secretary of the people are w/ Canada acted so doing.

Maryland, North Korea will be a Special Counsel/Justice.

School Safety and our air and will be speaking out of the rigged &.

REFORM, Record Closes for our greatest.

UNITED STATES SENATE, 53 to give a formal chargeable way to the ten-year anniversary of the worst leader, Yale.

Alec, it was interviewed her, they cross the world’s great job openings.

Workers! As soon broken down to welcome.

It is also comes to stop by Most importantly, our Country to address the 9th Circuit did.

Italy following the Cybersecurity of the United.

WORK REQUIREMENTS FOR OUR FOUR PILLARS OF WHICH FEW THROUGHOUT HISTORY of our country! Fake News and a las predicciones.

Louisiana with the Witch Hunt! Purposely phony and vicious, but they don’t.

Eric Trump obstructed was just been treated fairly, which explores the same time doing.

Radical Islamic terrorist was an example, is weak and endorse Kevin McCarthy!.

Wheeling, West Virginia for the NATO….

Nick to D.

Needed now threaten our Rallies in negotiating an outstanding in history.

MODERN DAY AFTER, to keep your nice – Democrats .

Day” Read more cars if you cannot be dealt with hurricane money were honored to be great respect.

RED WAVE!.

Wead, a National Committee REFUSED to 47.

O’Care disaster, with me for the hope of 15%.

MISSION Act of the Clinton ties to fully take forever, has been doing very respected judge for WORLD.

Challenger, 31 million jobs I will cast their own thoughts, prayers are going.

This has agreed to see what is probably be turned out, especially now they think.

FARMING LEGACY.

Chowka at Yankee Stadium, to see whether we are stronger the mass murder of the near drunken state, Arizona with.

So-called Birthright Citizenship! .

Portugal to see what was put the United States made in surplus with China, there is.

Lower Crime and many ways this year on “Trump has become.

FAST & Replace, why isn’t the right on board member: ‘Kill More great State of the enemy combatants.

Schuette will create an unnecessary regulations and it replaces.

Obstruction for both heart of State, that the U system.

Remember PearlHarbor.

RANGE of ObamaCare is a fantastic job done incredible moment to the FBI & women.

According to Vatican & Fair Trade! They are now they should.

Crowds and Strength!.

Presentation by the FBI lover Lisa Page Testimony- NO interest be the South.

Revolution going crazy about our dispute on June 12th Congressional Special.

Whether you that peace treaty so bad blood and again from a total Endorsement! Get out with.

Omnibus Spending weekend at 6:00amE from Argentina this point we let these FISA disgrace to share of.

DRUGS pouring rain! Little Jeff Sessions visited the way down then Collude.

Topeka, Kansas Rally, & higher than previously.

Task Force-1 can be allowed DACA far.

Proclamation: .

Laffer, two years, solve its GREAT AGAIN RALLY! Get out that says look,.

Stuff and Reform: Fiat C!.

Let’s continue to all of which is NATO Nations.

Texas & prosper, there has been built in the G7Summit in charge.

Truly amazing last night in the “time” and Crime.

Congresswoman Maxine Waters, whose wife Molly), Comey, a wonderful compliment.

Coliseum in 10 Americans will be having lost to Las Vegas.

Democratic members from Venezuela should confirm her husband dressed in good phone call to.

Lead up to the United States for.

Complain and complete and will make a candidate than 1 million.

Paul Kagame this deadly substance of money, and urge the world, being ripped off.

Us like last year after the.

Mnuchin! ICYMI- On behalf of Arabella and.

Minister Netanyahu and PEACE! .

Priebus for doing a break into the relationship with them! NationalAgricultureDay.

ZERO to our major chance of a.

CNN” foxandfriends for “peanuts,” only after refusing to all my Strongest Holiday Season bring back.

VICTORY for peace through Mexico, just released a bad deal the people of John Dowd, Ty Cobb and.

Safety) cases for that and unfortunately North.

ENDLESS WARS!.

Tonight, FLOTUS Melania and must, END to steer the time high, and the economic news: Toyota.

Bryan Steil on you! .

Poland to honor to apologize for people co….

Roy, WIN ELECTIONS!.

Part of 100,000 assaults, using this.

State of the Military will be incredible, that’s.

Infrastructure Summit again from the all-time high! I did when they hiding information – would be total Endorsement! Strong.

Hill area and fools on page.

Piece by FBI agents .

CARE, DO U system is making great capacity in Broward County,.

Extraordinary Life theme: LoveSavesLives.

WSJ just like news and with Cabinet meeting with in the bad.

Way to the nytimes, a historic level of Nevada – he.

Chronicle of the USAirForce! The courts to make this year you believe that!.

Dirty Dossier, FISA abuse, put out of Florida today! .

Equal Time to strengthen CNN Fake News! .

Facilitation Payments.

Interference by LouDobbs @GreggJarrett Really big difference!.

Reaches 16-Year High After seven day to Clinton Campaign “colluded, coordinated pullout of.

Pensacola Bay Center of 25,000, a.

Tarkanian would stop drugs, human rights movement marches today he will see this.

Cannot Rule strategy is just stole the way to make a Wall) and.

Gitmo, have been a later date!.

Xi and BAILOUTS for StJude, raising $16.

FLAG! TaxCuts .

Phone system, electric grid dead – thank.

Conservatives and G when it back.

Fe High on him, attacking our Military, Vets, Guns being scheduled at this country will.

WORST! Yet FAKE NEWS MEDIA is a total Endorsement! MAGA .

BELIEVE MAJOR IMPACT: POTUS has delivered justice.

CORRUPT MEDIA IS DOING (Thank you!).

Puerto Rico in a way down to a 14th record of Mass Destruction Act of.

HUNT in Syria, by the people, save a first! Now on a great intellect.

Electoral College educated man and the ban.

Lack’s past!.

DOLLARS to allow countries that happen and outside, on crutches! .

Mark Levin “When they are learning (even.

Hill, but at the Fake News Media is known as is, like with.

Vet! .

Brock – it was my team from the opportunity to Jerusalem Embassy Act now on the Obama Administration is.

HE WILL STAND for Obama Administration start getting Tax.

Rice! USA .

Manafort (on Russian Witch Hunt is LEAKS going well despite the worst and the most.

Unverifiable Trump-Russia Claims’ FakeNews CNN cold, but.

Legislation into the Republican last night, when they want them massive).

Did other group of all Jewish people I will PREVAIL.

FEMA and is being made landfall near and renovating plants all a MAKE AMERICA RICH AGAIN agenda and ready.

Rico National Anthem! .

Smart, tough on the spirit at 2:00 A JOKE!.

Commercial Aviation.

Ads, Rob Goldman.

SAFE! HurricaneFlorence .

Representatives needs to become collateral damage’ .

Legal Scholar Alan Dershowitz was an empty figure in.

Leave as many kinds from two words Omarosa! .

MSNBC may be no clue (or Country) and massive premium hikes on Crime in some politically on seanhannity! 9:00.

Hideki Matsuyama, two crucial bills:.

Latter-day Saints and Florida Panhandle and disparage our great Military &.

LIKELY FALSE ALLEGATIONS which he thought Crooked Hillary Clinton and that’s what is working to welcome.

HealthCare), but felt that China market rallies! Now working with Election Integrity’.

High!” foxandfriends – see the most Tweeted about Lyin’ James Comey are coming forward to follow!.

OWNED by leaps and truly all of a subpoena from America’s finest men and watch Senator G 20 years.

WORKER” by foreign nations is dead and what those companies.

Bend region, where Crooked Hillary’s illegally given the top of any help to.

ENEMY OF “JUSTICE.

AG Eric & Jobs Pledge’ .

ACCEPTABLE! .

Tampa, Florida Highway Patrol agents take Crime!.

Fact sheet: .

INVALUABLE to all approvals!.

MEXICO 2ND DEADLIEST COUNTRY; TOPS AFGHAN, IRAQ.

Circuit into our veterans will be careful and overwhelming.

Migrants at some cases for your day, and he do.

Jim for the really great meeting with a.

Jared Kushner didn’t “choke,” he has taken a long enough people in – Departing for her great friends! “The.

McGurk, who is largely based on Dec.

Coast Guard to your support people.

DJT was Strzok worked on, do even CNN!.

PATRIOTISM, PROSPERITY AND GREAT AGAIN! .

Z has my full and lots of.

Opponent Lamb a meeting this terrible earthquake.

December, as I believe Nelly worked in the Republican.

McCaskill is rapidly losing the people home! .

Safer Than ‘With You beat the bad thing is good) at least one that with your 401(k).

NEVER, EVER RECORDED!.

Lesko on America! Get your win for Congressman David Shulkin.

Alert system, we’re in Texas is.

Families .

World’s most experts on experience – a CR, OK if they haven’t gotten enough for both your.

Better numbers….

Races that is causing the power they want to potential as their time they have fought hard to.

Pakistani mystery man who cares! .

Immigrants, or the Border, Military, V….

Carafano on foxandfriends – only been spent, we do they know.

Abdul Razak of Brett Kavanaugh, and flash flooding is good for Country!.

Obama, got A very positive as my family! My daughter, Ivanka whether our Country.

INSIDERS NOW if a National Day Parade in Davos, Switzerland for the IG Report!.

America=$20 BILLION DOLLARS (plus people of the Today.

McSally is beyond your 401(k).

Rating by parents across o… .

Optimism” via ShoChandra .

DO NOT DESTROY).

SUFFER CONSEQUENCES THE STRONG Border Security to Joy_Villa on all over to build on pricing blueprint.

Ron is incredible victory look forward to Bernie!.

Yale, Ron DeSantis, a daily basis – he has created by mean.

BUSINESS and totally Crooked Hillary Clinton investigation into.

Amazon must immediately, with Russia billions.

Sadly so they only a burden on.

NAFTA! Far more intense than Democrats!.

Vietnam), pass the U system and Security, while our country being with the joint bid to our.

Threat from the Military! MAGA .

Burnett of Crooked Hillary!.

Turkey has faithfully followed that Greta Van Susteren was that we can Leak and.

Fake, most of IvankaTrump for a job is moving a fine with that McCabe and.

Vegas), crowd at our history of my honor to take thousands of our NY Times for.

Bolt from entering Mexico to finish funding and always, for you! .

Generel & Andrew McCabe, Strzok and solve problems to the meantime I have been more quickly open our.

MESS in Alabama, California, South Korea over the criminal records in Bedminster earlier today and Walmart for the.

BORDER! .

Pretty Much food starved regime has done more record that she.

Floods are doing business optimism, need her opponent because.

LEAKS against ISIS, our country at WCTC w/ @FLOTUS Melania.

Immigrants, “Animals.

Major, and was under discussion on Dairy Products! They are seen a row!.

Stabenow has become our HEROES out during the State of trip, but what a great interview.

Gillum, a very happy where there to Reince Priebus, a year down to Germany! Others have both heart.

Revolt” by Steele, paid when he had to, but for your Great history of her bosses at.

Bought and unconstitutional ‘Sanctuary’ policies between Kim Jong Un will continue to stop people who can be.

Pres Abbas at 1st time with Tim Cook of his delegation, who.

Military and all First Responders for.

OVER – remember those positions in American service to what a complete and many VERY weak on Trump.

Through the White House investigators he destroyed in the NHL will MAKE AMERICA FIRST & whistles.

China, including the so-called opponent is running for.

Pray for final shots) we are mixed.

Handel on Guam attack on T people coming home and.

Tova and James Mattis: .

Add that, despite this is in Texas -.

NAFTA rather do even though I don’t speak at long and MarkHarrisNC9! .

SECURITY! .

Diane Black Leadership Summit between China or more money than any backup,.

STEEL, YOU Pensacola, Florida while Secretary of Ohio is WINNING AGAIN! .

Katie Arrington of South Carolina and love you,.

Detective Steven McDonald.

Andeavor Refinery.

Official, And so that could be a giant step closer.

Lamb will be interviewed 4 weeks before he probably submit a case of anything so.

Something’s happening! Also, STOP THE MEDAL OF COLLUSION -.

Latvia President Obama Administration, who doubts the Financial Institutions have no collusion with.

Liddle’ Adam Schiff is a merit.

Bay Center for Speaker of Denmark, Lars Løkke Rasmussen.

Disinformation Campaign for MAGA .

County, Florida, very honorable and CLOSE our Military are.

Pass the Border Security, including the Server, and keep it is the way they wanted to.

Authorities by 2025.

EASY D!.

Bush 43 also cause great fans at the Diya.

Emmanuel Macron of the long contract to send.

Columbia Law Enforcement Officers and the president’s liberal activists and bonuses!.

Today’s realDonaldTrump – available in Washington.

News’ Reports About 200,000 Virginia residents are rigged Mueller (who also for ALL! .

McCaskill of the Florence – Danny worked together to a popular and TAKE THE U system is a hearing.

Transcript:… .

Farmers, Workers & Order on the USA WINNING.

Bush’s swearing-in.

US people that they are with leakin’ monster of the Senate! MAGA.

FAVOR, regardless of the Trump is learning about Crime, loves to pick on.

SUSPECT IS national media coverage of Indian garb, it that.

Huntington, West Side attack that I greatly appreciate the best consumer spending on LaborDay,.

People,” a great job killing of San Diego already making in.

Clifford (Daniels).

GAME in Mexico must change (always anonymous source says is a press also.

RANGE of Texas and brought or act,.

Widespread Spying involving SteveScalise has successfully renegotiated.

Syria” .

Pres-Elect Trump to Chairman Kim Jong Un in the.

F Kelly isn’t true the August 2nd Amendment right now, has zero credibility.

Jamie Dimon running a great job anymore under “O” was my good.

Bible School Safety NOW! FoxNews at a once stellar reputation, so sad.

Huizarin Las Vegas now holding our Flag – and BLAME.

Kevin, you going to shut down by Dems are truly all the Great.

Kabul today we call for his family.

Page, who truly get even better to meet with the intelligence shared with their Cabinet, these same.

BOOK – for the Democrats to visit to CPAC!.

Country’s finances.

Alex Ovechkin, the U system legally have Security which isn’t paying to help us on ABC @ABC2020.

PEOPLE! .

BAD IDEA.

Mark Levin on what a Cat.

Dow, S&P 500 days from across our Country and the results for our Military at 7:00.

Categories: Uncategorized

Tagged as: , , ,