Editorial Workflows

Thesaurus

unlisted workflow

Install Workflow...

This workflow contains at least one Python script. Only use it if you trust the person who shared this with you, and if you know exactly what it does.

I understand, install the workflow!

This is a workflow for Editorial, a Markdown and plain text editor for iOS. To download it, you need to view this page on a device that has the app installed.

Description: Select a word or enter a word manually to see a list of synonyms.

Comments: Comment Feed (RSS)

There are no comments yet.

+ Add Comment

Workflow Preview
Selected Text ?
Entire Line(s)
OFF
Empty Selection Output
  • No Output
  • All Text
  • Closest Word
Folded Text
  • Include
  • Replace with:
If… ?
Run the block if
Input
  • is Equal to
  • is Not Equal to
  • Contains
  • Doesn't Contain
  • Matches Regular Expression
Set Variable ?
Variable Name
query
Value
Input
…End If
If… ?
Run the block if
Input
  • is Equal to
  • is Not Equal to
  • Contains
  • Doesn't Contain
  • Matches Regular Expression
Request Text Input ?
Title
Look Up
Initial Text
  • Single Line
  • Multiple Lines
Keyboard Options:
Set Variable ?
Variable Name
query
Value
Input
…End If
If… ?
Run the block if
query
  • is Equal to
  • is Not Equal to
  • Contains
  • Doesn't Contain
  • Matches Regular Expression
Show HUD ?
HUD Text
Select or enter a word.
Duration
  • 1 Second
  • 2 Seconds
  • 3 Seconds
Icon
  • "Success"
  • "Error"
Stop ?
Stop
  • This Workflow
  • Repeat Block
Show HUD Alert
OFF
Message
Stopped
…End If
If… ?
Run the block if
Input
  • is Equal to
  • is Not Equal to
  • Contains
  • Doesn't Contain
  • Matches Regular Expression
Show HUD ?
HUD Text
Input cannot contain spaces.
Duration
  • 1 Second
  • 2 Seconds
  • 3 Seconds
Icon
  • "Success"
  • "Error"
Stop ?
Stop
  • This Workflow
  • Repeat Block
Show HUD Alert
OFF
Message
Stopped
…End If
Run Python Script ?
Source Code
#coding: utf-8
import workflow
import requests
import re

api_key = '5e5dbaeb133644e4c2f34049b629fe0c'

action_in = workflow.get_input()

char = action_in[0]
capitalize = re.match('[A-Z]', char)

api_url = 'http://words.bighugelabs.com/api/2/' + api_key + '/' + action_in + '/'

r = requests.get(api_url)

matches = re.findall('^(.*?)\|(.*?)\|(.*?)$', r.text, re.MULTILINE)

out = ''
for match in matches:
	if match[1] == 'syn':
		word = match[2]
		if capitalize:
			word = match[2].capitalize()
		out += word + ' (' + match[0] + ")\t" + word + "\n"

if len(out) > 0:
	out = out[:-1]
	
workflow.set_output(out)
If… ?
Run the block if
Input
  • is Equal to
  • is Not Equal to
  • Contains
  • Doesn't Contain
  • Matches Regular Expression
Show HUD ?
HUD Text
No synonyms found.
Duration
  • 1 Second
  • 2 Seconds
  • 3 Seconds
Icon
  • "Success"
  • "Error"
Stop ?
Stop
  • This Workflow
  • Repeat Block
Show HUD Alert
OFF
Message
Stopped
…End If
Select from List ?
Title
Select a Synonym
List (Lines)
Input
Multiple Selection
OFF
Show in Popover
ON
Replace Selected Text ?
Replacement Text
Input