Mattt

@mattt

Founder of and . Writer and developer living in Portland, Oregon.

Portland, OR
Vrijeme pridruživanja: prosinac 2006.

Tweetovi

Blokirali ste korisnika/cu @mattt

Jeste li sigurni da želite vidjeti te tweetove? Time nećete deblokirati korisnika/cu @mattt

  1. 27. sij

    swift-doc is available to try out today, both as a command-line utility and a Action. Please take a look when you have a chance, and let me know what you think! 😁

    Prikaži ovu nit
    Poništi
  2. 27. sij

    With SwiftSemantics, I was able to build tools I'd been thinking about for years in just a few hours. For example, a utility that prints a package's public-facing APIs on separate lines (allowing you to diff for changes between versions)

    $ swift run swift-api-inventory SwiftSemantics/Sources | less
struct AssociatedType: Declaration, Hashable, Codable, ExpressibleBySyntax
var AssociatedType.attributes { get }
var AssociatedType.context { get }
var AssociatedType.keyword { get }
var AssociatedType.modifiers { get }
var AssociatedType.name { get }
...

$ swift run swift-api-inventory SwiftSemantics/Sources | wc
     207    1023    8993
    Prikaži ovu nit
    Poništi
  3. 27. sij

    Actually, the CommonMark package I wrote for SwiftMarkup is pretty cool in its own right — especially with the function builder interface I added to it over the weekend. For your consideration for anyone in market for Markdown-related functionality.

    import CommonMarkBuilder

let document = Document {
    Heading {
        Link(urlString: "https://www.un.org/en/universal-declaration-human-rights/",
                title: "View full version")
        {
            "Universal Declaration of Human Rights"
        }
    }

    Section { // sections increase the level of contained headings
        Heading { "Article 1." } // this is a second-level heading
    }

    F
    Prikaži ovu nit
    Poništi
  4. 27. sij

    SwiftMarkup is the other key player in swift-doc. It parses documentation comments into structured entities.

    let markdown = #"""
Creates a new bicycle with the provided parts and specifications.

- Remark: Satisfaction guaranteed!

The word *bicycle* first appeared in English print in 1868
to describe "Bysicles and trysicles" on the
"Champs Elysées and Bois de Boulogne".

- Parameters:
   - style: The style of the bicycle
   - gearing: The gearing of the bicycle
   - handlebar: The handlebar of the bicycle
   - frameSize: T
    Prikaži ovu nit
    Poništi
  5. 27. sij

    swift-doc's secret sauce is a package called SwiftSemantics, which builds on top of SwiftSyntax to provide a conventional, document-oriented interface to reasoning about declarations in Swift code.

    import SwiftSyntax
import SwiftSemantics

let source = """
import UIKit

class ViewController: UIViewController, UITableViewDelegate {
    enum Section: Int {
        case summary, people, places
    }

    var people: [People], places: [Place]

    @IBOutlet private(set) var tableView: UITableView!
}
"""

var collector = DeclarationCollector()
let tree = try SyntaxParser.parse(source: source)
tree.walk(&collector)
    Prikaži ovu nit
    Poništi
  6. 27. sij

    One of the distinguishing features of swift-doc is that it operates on Swift code at a syntactic level, without first compiling it. 2 primary effects: 1. Operational Simplicity: It can be installed both macOS and Linux as a standalone binary 2. Speed: It's fast

    $ cd SwiftSemantics

$ time swift-doc Sources
        0.21 real         0.16 user         0.02 sys

$ time jazzy # fresh build
jam out ♪♫ to your fresh new docs in `docs`
       67.36 real        98.76 user         8.89 sys


$ time jazzy # with build cache
jam out ♪♫ to your fresh new docs in `docs`
       17.70 real         2.17 user         0.88 sys
    Prikaži ovu nit
    Poništi
  7. 27. sij

    Introducing swift-doc: an (experimental) command-line utility for generating documentation for Swift projects. It's still early on, but I'm really excited about the infrastructure behind it, and how it can be used to develop Swift tooling. 🧵⬇️

    $ swift swift-doc path/to/SwiftProject/Sources \
			--output Documentation
$ tree Documentation
$ Documentation/
├── Home
├── (...)
├── _Footer.md
└── _Sidebar.md
    Prikaži ovu nit
    Poništi
  8. 15. sij

    I understand why this kind of information isn't provided in the documentation, but it'd be nice to know these limitations up front. Anyway, I hope that this information is useful to anyone working in this space. Happy to try and answer any questions you might have.

    Prikaži ovu nit
    Poništi
  9. 15. sij

    I was also surprised to see how limited NaturalLanguage support is on tvOS. Everything except English has only basic functionality, and even that is missing lemmatized forms and sentiment.

    Prikaži ovu nit
    Poništi
  10. 15. sij

    My biggest takeaway was that Apple's built-in NLP features are a nonstarter for East-Asian languages. If you want to make an app that, for example, parses Japanese text, you'll need to incorporate something like MeCab ()

    Prikaži ovu nit
    Poništi
  11. 15. sij

    Summary of my findings: - English, French, German, Italian, Portuguese, Spanish support all NLTagger schemes - Russian and Turkish support all except sentiment - All other languages support only language / script detection and tokenization

    Prikaži ovu nit
    Poništi
  12. 15. sij

    For those of you curious to know which languages are supported for these NLP tools, I wrote up a quick script to generate a support matrix here (with results for macOS, iOS, and tvOS):

    Prikaži ovu nit
    Poništi
  13. 13. sij

    `lemma` provides the lemmatized forms (stems) of words in text.

    $ echo "Don't be amazed if you see my eyes always wandering." | lemma
do	Do
not	n't
be	be
amaze	amazed
if	if
you	you
see	see
I	my
eye	eyes
always	always
wander	wandering
    Prikaži ovu nit
    Poništi
  14. 13. sij

    `sentiment` evaluates natural language text for emotional polarity, producing a value between -1 (most negative), 0 (neutral), and 1 (most positive).

    $ echo "No wireless, less space than a Nomad. Lame." | sentiment
-0.8
    Prikaži ovu nit
    Poništi
  15. 13. sij

    `sentences` splits text into sentences, printing each on a new line.

    $ echo "Designed by Apple in California. Assembled in China." | sentences
Designed by Apple in California. 
Assembled in China.

$ echo "由位于加利福尼亚州的苹果公司设计。 中国组装。" | sentences
由位于加利福尼亚州的苹果公司设计。 
中国组装。
    Prikaži ovu nit
    Poništi
  16. 13. sij

    `pos` tokenizes natural language into words and tags their part of speech (noun / verb / adjective / etc.)

    $ echo "The quick brown fox jumps over the lazy dog." | pos
DETERMINER	The
ADJECTIVE	quick
ADJECTIVE	brown
NOUN	fox
VERB	jumps
PREPOSITION	over
DETERMINER	the
ADJECTIVE	lazy
NOUN	dog
    Prikaži ovu nit
    Poništi
  17. 13. sij

    `ner` extracts the names of people, places, and organizations from natural language text.

    $ echo "Designed by Apple in California." | ner
ORGANIZATION	Apple
PLACE	California
    Prikaži ovu nit
    Poništi
  18. 13. sij

    A while back, I published some command-line interfaces to Apple’s NaturalLanguage framework. If you do any text processing on macOS, you might find these tools to be handy: 🧵⬇️

    Prikaži ovu nit
    Poništi
  19. proslijedio/la je Tweet
    9. pro 2019.
    Poništi
  20. proslijedio/la je Tweet
    6. pro 2019.

    XCFrameworks for CocoaPods has been merged! 🎉

    Poništi

Čini se da učitavanje traje već neko vrijeme.

Twitter je možda preopterećen ili ima kratkotrajnih poteškoća u radu. Pokušajte ponovno ili potražite dodatne informacije u odjeljku Status Twittera.

    Možda bi vam se svidjelo i ovo:

    ·