Skip to content

engelskan/pronounce

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pronounce

A tool for pronouncing English words using the database of Oxford Learner’s Dictionaries.

Installation

Clone the repository and then run:

cargo run cat

For convenience of invocation, add an alias to your .bash_profile:

echo "alias pronounce='cargo run --quiet --manifest-path="${PWD}/Cargo.toml"'" >> ~/.bash_profile

On macOS, one can also assign a shortcut to the tool so that, regardless of the active application, a selected word can be easily looked up using a single keystroke. To this end,

  • open Automator,
  • select “Service” as the document type,
  • add “Run AppleScript” to the workflow,
  • copy, paste, and adjust the following code:
on run {input, parameters}
	set rustup to "${HOME}/.rustup/toolchains/nightly-x86_64-apple-darwin"
	set pronounce to "<PATH TO THIS REPOSITORY>"
	set command to "PATH=${PATH}:" & rustup & "/bin cargo run --manifest-path=" & pronounce & "/Cargo.toml " & input
	try
		do shell script command
	end try
	return input
end run
  • save the service,
  • open System Preferences,
  • go to Keyboard → Shortcuts → Services, and
  • look for your service and add a shortcut, for instance, ⌃⌘P.

Contribution

Your contribution is highly appreciated. Do not hesitate to open an issue or a pull request. Note that any contribution submitted for inclusion in the project will be licensed according to the terms given in LICENSE.md.

Releases

No releases published

Packages

No packages published

Languages